File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
jscomp/gentype_tests/typescript-react-example/src Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ export type fromPayload = { readonly x: number; readonly s: string };
1515// tslint:disable-next-line:interface-over-type-literal
1616export type toPayload = { readonly result : string } ;
1717
18+ // tslint:disable-next-line:interface-over-type-literal
19+ export type settledResult < a > =
20+ { TAG : "fulfilled" ; readonly value : a }
21+ | { TAG : "rejected" ; readonly reason : unknown } ;
22+
23+ // tslint:disable-next-line:interface-over-type-literal
24+ export type settled = settledResult < string > ;
25+
1826export const convert : ( _1 :Promise < fromPayload > ) => Promise < toPayload > = TestPromiseBS . convert ;
1927
2028export const barx : ( _1 :{ readonly x ?: Promise < ( undefined | string ) > } , _2 :void ) => boolean = TestPromiseBS . barx ;
Original file line number Diff line number Diff line change @@ -11,3 +11,11 @@ type fromPayload = {
1111@genType let convert = Js .Promise .then_ (({s }) => Js .Promise .resolve ({result : s }))
1212
1313@genType let barx = (~x = Js .Promise .resolve (Some ("a" )), ()) => x == x
14+
15+ @genType
16+ @tag ("status" )
17+ type settledResult <+ 'a > =
18+ | @as ("fulfilled" ) Fulfilled ({value : 'a }) | @as ("rejected" ) Rejected ({reason : unknown })
19+
20+ @genType
21+ type settled = settledResult <string >
You can’t perform that action at this time.
0 commit comments