File tree Expand file tree Collapse file tree 7 files changed +20
-0
lines changed Expand file tree Collapse file tree 7 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1212
1313# 10.1.1
1414
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+
1519#### :bug : Bug Fix
1620
1721- 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 =
21382138 | [] , Some (representation ) when lid_sexp_list = [] ->
21392139 let optional_labels = match representation with
21402140 | Record_optional_labels optional_labels -> optional_labels
2141+ | Record_inlined {optional_labels} -> optional_labels
21412142 | _ -> [] in
21422143 let filter_missing (ld : Types.label_declaration ) =
21432144 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;
257257
258258var h10 = newrecord$3 ;
259259
260+ var ir4 = /* V0 */ {
261+ x : 3
262+ } ;
263+
264+ var ir5 = /* V0 */ { } ;
265+
260266exports . f1 = f1 ;
261267exports . f2 = f2 ;
262268exports . f3 = f3 ;
@@ -280,4 +286,6 @@ exports.pm2 = pm2;
280286exports . inlinedRecord = inlinedRecord ;
281287exports . pm3 = pm3 ;
282288exports . pm4 = pm4 ;
289+ exports . ir4 = ir4 ;
290+ exports . ir5 = ir5 ;
283291/* Not a pure module */
Original file line number Diff line number Diff line change @@ -122,3 +122,7 @@ let inlinedRecord = ir => switch ir {
122122}
123123let pm3 = inlinedRecord (ir2 )
124124let 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 =
4286342863 | [], Some (representation) when lid_sexp_list = [] ->
4286442864 let optional_labels = match representation with
4286542865 | Record_optional_labels optional_labels -> optional_labels
42866+ | Record_inlined {optional_labels} -> optional_labels
4286642867 | _ -> [] in
4286742868 let filter_missing (ld : Types.label_declaration) =
4286842869 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 =
4286342863 | [], Some (representation) when lid_sexp_list = [] ->
4286442864 let optional_labels = match representation with
4286542865 | Record_optional_labels optional_labels -> optional_labels
42866+ | Record_inlined {optional_labels} -> optional_labels
4286642867 | _ -> [] in
4286742868 let filter_missing (ld : Types.label_declaration) =
4286842869 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 =
219035219035 | [], Some (representation) when lid_sexp_list = [] ->
219036219036 let optional_labels = match representation with
219037219037 | Record_optional_labels optional_labels -> optional_labels
219038+ | Record_inlined {optional_labels} -> optional_labels
219038219039 | _ -> [] in
219039219040 let filter_missing (ld : Types.label_declaration) =
219040219041 let name = Ident.name ld.ld_id in
You can’t perform that action at this time.
0 commit comments