File tree 7 files changed +20
-0
lines changed
7 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 12
12
13
13
# 10.1.1
14
14
15
+ #### :rocket : New Feature
16
+
17
+ - Add support for empty inlined record literal ` {} ` for inlined records where all fields are optional https://github.com/rescript-lang/rescript-compiler/pull/5900
18
+
15
19
#### :bug : Bug Fix
16
20
17
21
- Prevent inlining of async functions in additional cases https://github.com/rescript-lang/rescript-compiler/issues/5860
Original file line number Diff line number Diff line change @@ -2138,6 +2138,7 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected =
2138
2138
| [] , Some (representation ) when lid_sexp_list = [] ->
2139
2139
let optional_labels = match representation with
2140
2140
| Record_optional_labels optional_labels -> optional_labels
2141
+ | Record_inlined {optional_labels} -> optional_labels
2141
2142
| _ -> [] in
2142
2143
let filter_missing (ld : Types.label_declaration ) =
2143
2144
let name = Ident. name ld.ld_id in
Original file line number Diff line number Diff line change @@ -257,6 +257,12 @@ var h = newrecord$2;
257
257
258
258
var h10 = newrecord$3 ;
259
259
260
+ var ir4 = /* V0 */ {
261
+ x : 3
262
+ } ;
263
+
264
+ var ir5 = /* V0 */ { } ;
265
+
260
266
exports . f1 = f1 ;
261
267
exports . f2 = f2 ;
262
268
exports . f3 = f3 ;
@@ -280,4 +286,6 @@ exports.pm2 = pm2;
280
286
exports . inlinedRecord = inlinedRecord ;
281
287
exports . pm3 = pm3 ;
282
288
exports . pm4 = pm4 ;
289
+ exports . ir4 = ir4 ;
290
+ exports . ir5 = ir5 ;
283
291
/* Not a pure module */
Original file line number Diff line number Diff line change @@ -122,3 +122,7 @@ let inlinedRecord = ir => switch ir {
122
122
}
123
123
let pm3 = inlinedRecord (ir2 )
124
124
let pm4 = inlinedRecord (ir3 )
125
+
126
+ type inlinedOptional2 = V0 ({x ?: int })
127
+ let ir4 = V0 ({x : 3 })
128
+ let ir5 = V0 ({})
Original file line number Diff line number Diff line change @@ -42863,6 +42863,7 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected =
42863
42863
| [], Some (representation) when lid_sexp_list = [] ->
42864
42864
let optional_labels = match representation with
42865
42865
| Record_optional_labels optional_labels -> optional_labels
42866
+ | Record_inlined {optional_labels} -> optional_labels
42866
42867
| _ -> [] in
42867
42868
let filter_missing (ld : Types.label_declaration) =
42868
42869
let name = Ident.name ld.ld_id in
Original file line number Diff line number Diff line change @@ -42863,6 +42863,7 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected =
42863
42863
| [], Some (representation) when lid_sexp_list = [] ->
42864
42864
let optional_labels = match representation with
42865
42865
| Record_optional_labels optional_labels -> optional_labels
42866
+ | Record_inlined {optional_labels} -> optional_labels
42866
42867
| _ -> [] in
42867
42868
let filter_missing (ld : Types.label_declaration) =
42868
42869
let name = Ident.name ld.ld_id in
Original file line number Diff line number Diff line change @@ -219035,6 +219035,7 @@ and type_expect_ ?in_function ?(recarg=Rejected) env sexp ty_expected =
219035
219035
| [], Some (representation) when lid_sexp_list = [] ->
219036
219036
let optional_labels = match representation with
219037
219037
| Record_optional_labels optional_labels -> optional_labels
219038
+ | Record_inlined {optional_labels} -> optional_labels
219038
219039
| _ -> [] in
219039
219040
let filter_missing (ld : Types.label_declaration) =
219040
219041
let name = Ident.name ld.ld_id in
You can’t perform that action at this time.
0 commit comments