File tree 4 files changed +51
-5
lines changed
tests/gentype_tests/typescript-react-example/src/nested
4 files changed +51
-5
lines changed Original file line number Diff line number Diff line change 21
21
- Allow single newline in JSX. https://github.com/rescript-lang/rescript/pull/7269
22
22
- Editor: Always complete from Core first. Use actual native regex syntax in code snippets for regexps. https://github.com/rescript-lang/rescript/pull/7295
23
23
- Add ` type t ` to Stdlib modules. https://github.com/rescript-lang/rescript/pull/7302
24
+ - Gentype: handle null/nullable/undefined from Stdlib. https://github.com/rescript-lang/rescript/pull/7132
24
25
25
26
#### :bug : Bug fix
26
27
Original file line number Diff line number Diff line change @@ -222,21 +222,26 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env =
222
222
{dependencies = [] ; type_ = EmitType. type_react_element}
223
223
| ([" FB" ; " option" ] | [" option" ]), [param_translation] ->
224
224
{param_translation with type_ = Option param_translation.type_}
225
- | ( ([" Js" ; " Undefined" ; " t" ] | [" Undefined" ; " t" ] | [" Js" ; " undefined" ]),
225
+ | ( ( [" Js" ; " Undefined" ; " t" ]
226
+ | [" Undefined" ; " t" ]
227
+ | [" Js" ; " undefined" ]
228
+ | [" Stdlib" ; " undefined" ] ),
226
229
[param_translation] ) ->
227
230
{param_translation with type_ = Option param_translation.type_}
228
231
| ( ( [" Js" ; " Null" ; " t" ]
229
232
| [" Null" ; " t" ]
230
233
| [" Js" ; " null" ]
231
- | [" Stdlib" ; " Null" ; " t" ] ),
234
+ | [" Stdlib" ; " Null" ; " t" ]
235
+ | [" Stdlib" ; " null" ] ),
232
236
[param_translation] ) ->
233
237
{param_translation with type_ = Null param_translation.type_}
234
238
| ( ( [" Js" ; " Nullable" ; " t" ]
235
239
| [" Nullable" ; " t" ]
236
240
| [" Js" ; " nullable" ]
237
241
| [" Js" ; " Null_undefined" ; " t" ]
238
242
| [" Js" ; " null_undefined" ]
239
- | [" Stdlib" ; " Nullable" ; " t" ] ),
243
+ | [" Stdlib" ; " Nullable" ; " t" ]
244
+ | [" Stdlib" ; " nullable" ] ),
240
245
[param_translation] ) ->
241
246
{param_translation with type_ = Nullable param_translation.type_}
242
247
| ( ( [" Js" ; " Promise" ; " t" ]
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