File tree 4 files changed +54
-7
lines changed
tests/gentype_tests/typescript-react-example
4 files changed +54
-7
lines changed Original file line number Diff line number Diff line change @@ -213,17 +213,24 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env =
213
213
{dependencies = [] ; type_ = EmitType. type_react_element}
214
214
| ([" FB" ; " option" ] | [" option" ]), [param_translation] ->
215
215
{param_translation with type_ = Option param_translation.type_}
216
- | ( ([" Js" ; " Undefined" ; " t" ] | [" Undefined" ; " t" ] | [" Js" ; " undefined" ]),
216
+ | ( ( [" Js" ; " Undefined" ; " t" ]
217
+ | [" Undefined" ; " t" ]
218
+ | [" Js" ; " undefined" ]
219
+ | [" Pervasives" ; " undefined" ] ),
217
220
[param_translation] ) ->
218
221
{param_translation with type_ = Option param_translation.type_}
219
- | ([" Js" ; " Null" ; " t" ] | [" Null" ; " t" ] | [" Js" ; " null" ]), [param_translation]
220
- ->
222
+ | ( ( [" Js" ; " Null" ; " t" ]
223
+ | [" Null" ; " t" ]
224
+ | [" Js" ; " null" ]
225
+ | [" Pervasives" ; " null" ] ),
226
+ [param_translation] ) ->
221
227
{param_translation with type_ = Null param_translation.type_}
222
228
| ( ( [" Js" ; " Nullable" ; " t" ]
223
229
| [" Nullable" ; " t" ]
224
230
| [" Js" ; " nullable" ]
225
231
| [" Js" ; " Null_undefined" ; " t" ]
226
- | [" Js" ; " null_undefined" ] ),
232
+ | [" Js" ; " null_undefined" ]
233
+ | [" Pervasives" ; " nullable" ] ),
227
234
[param_translation] ) ->
228
235
{param_translation with type_ = Nullable param_translation.type_}
229
236
| ( ([" Js" ; " Promise" ; " t" ] | [" Promise" ; " t" ] | [" promise" ]),
Original file line number Diff line number Diff line change @@ -47,6 +47,26 @@ export type nullOrString = (null | string);
47
47
48
48
export type nullOrString2 = ( null | string ) ;
49
49
50
+ export type nullOrString3 = ( null | string ) ;
51
+
52
+ export type nullOrString4 = ( null | string ) ;
53
+
54
+ export type nullableOrString = ( null | undefined | string ) ;
55
+
56
+ export type nullableOrString2 = ( null | undefined | string ) ;
57
+
58
+ export type nullableOrString3 = ( null | undefined | string ) ;
59
+
60
+ export type nullableOrString4 = ( null | undefined | string ) ;
61
+
62
+ export type undefinedOrString = ( undefined | string ) ;
63
+
64
+ export type undefinedOrString2 = ( undefined | string ) ;
65
+
66
+ export type undefinedOrString3 = ( undefined | string ) ;
67
+
68
+ export type undefinedOrString4 = ( undefined | string ) ;
69
+
50
70
export type record = { readonly i : number ; readonly s : string } ;
51
71
52
72
export type decorator < a , b > = ( _1 :a ) => b ;
Original file line number Diff line number Diff line change @@ -64,9 +64,29 @@ type genTypeMispelled = int
64
64
65
65
@genType let jsonStringify = Js .Json .stringify
66
66
67
- @genType type nullOrString = Js . Null . t <string >
67
+ @genType type nullOrString = null <string >
68
68
69
- @genType type nullOrString2 = Js .null <string >
69
+ @genType type nullOrString2 = Null .t <string >
70
+
71
+ @genType type nullOrString3 = Js .null <string >
72
+
73
+ @genType type nullOrString4 = Js .Null .t <string >
74
+
75
+ @genType type nullableOrString = nullable <string >
76
+
77
+ @genType type nullableOrString2 = Nullable .t <string >
78
+
79
+ @genType type nullableOrString3 = Js .nullable <string >
80
+
81
+ @genType type nullableOrString4 = Js .Nullable .t <string >
82
+
83
+ @genType type undefinedOrString = undefined <string >
84
+
85
+ @genType type undefinedOrString2 = Undefined .t <string >
86
+
87
+ @genType type undefinedOrString3 = Js .undefined <string >
88
+
89
+ @genType type undefinedOrString4 = Js .Undefined .t <string >
70
90
71
91
type record = {
72
92
i : int ,
You can’t perform that action at this time.
0 commit comments