Skip to content

Commit 9419c6d

Browse files
committed
call the right fld_record_ functions
1 parent 01160ba commit 9419c6d

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

jscomp/ml/matching.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,10 +1614,9 @@ let make_record_matching loc all_labels def = function
16141614
| Record_regular | Record_optional_labels _ ->
16151615
Lprim (Pfield (lbl.lbl_pos, !Lambda.fld_record lbl), [arg], loc)
16161616
| Record_inlined _ ->
1617-
let name = Ext_list.find_def lbl.lbl_attributes find_name lbl.lbl_name in
1618-
Lprim (Pfield (lbl.lbl_pos, Fld_record_inline {name}), [arg], loc)
1617+
Lprim (Pfield (lbl.lbl_pos, !Lambda.fld_record_inline lbl), [arg], loc)
16191618
| Record_unboxed _ -> arg
1620-
| Record_extension -> Lprim (Pfield (lbl.lbl_pos + 1, Fld_record_extension {name = lbl.lbl_name}), [arg], loc)
1619+
| Record_extension -> Lprim (Pfield (lbl.lbl_pos + 1, !Lambda.fld_record_extension lbl), [arg], loc)
16211620
in
16221621
let str =
16231622
match lbl.lbl_mut with

jscomp/ml/translcore.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -889,14 +889,14 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda =
889889
(Pfield (lbl.lbl_pos, !Lambda.fld_record lbl), [ targ ], e.exp_loc)
890890
| Record_inlined _ ->
891891
Lprim
892-
( Pfield (lbl.lbl_pos, Fld_record_inline { name = lbl.lbl_name }),
892+
( Pfield (lbl.lbl_pos, !Lambda.fld_record_inline lbl),
893893
[ targ ],
894894
e.exp_loc )
895895
| Record_unboxed _ -> targ
896896
| Record_extension ->
897897
Lprim
898898
( Pfield
899-
(lbl.lbl_pos + 1, Fld_record_extension { name = lbl.lbl_name }),
899+
(lbl.lbl_pos + 1, !Lambda.fld_record_extension lbl),
900900
[ targ ],
901901
e.exp_loc ))
902902
| Texp_setfield (arg, _, lbl, newval) ->
@@ -906,10 +906,10 @@ and transl_exp0 (e : Typedtree.expression) : Lambda.lambda =
906906
| Record_regular | Record_optional_labels _ ->
907907
Psetfield (lbl.lbl_pos, !Lambda.fld_record_set lbl)
908908
| Record_inlined _ ->
909-
Psetfield (lbl.lbl_pos, Fld_record_inline_set lbl.lbl_name)
909+
Psetfield (lbl.lbl_pos, !Lambda.fld_record_inline_set lbl)
910910
| Record_unboxed _ -> assert false
911911
| Record_extension ->
912-
Psetfield (lbl.lbl_pos + 1, Fld_record_extension_set lbl.lbl_name)
912+
Psetfield (lbl.lbl_pos + 1, !Lambda.fld_record_extension_set lbl)
913913
in
914914
Lprim (access, [ transl_exp arg; transl_exp newval ], e.exp_loc)
915915
| Texp_array expr_list ->
@@ -1169,11 +1169,11 @@ and transl_record loc env fields repres opt_init_expr =
11691169
| Record_regular | Record_optional_labels _ ->
11701170
Pfield (i, !Lambda.fld_record lbl)
11711171
| Record_inlined _ ->
1172-
Pfield (i, Fld_record_inline { name = lbl.lbl_name })
1172+
Pfield (i, !Lambda.fld_record_inline lbl)
11731173
| Record_unboxed _ -> assert false
11741174
| Record_extension ->
11751175
Pfield
1176-
(i + 1, Fld_record_extension { name = lbl.lbl_name })
1176+
(i + 1, !Lambda.fld_record_extension lbl)
11771177
in
11781178
Lprim (access, [ Lvar init_id ], loc)
11791179
| Overridden (_lid, expr) -> transl_exp expr)
@@ -1259,11 +1259,11 @@ and transl_record loc env fields repres opt_init_expr =
12591259
| Record_regular | Record_optional_labels _ ->
12601260
Psetfield (lbl.lbl_pos, !Lambda.fld_record_set lbl)
12611261
| Record_inlined _ ->
1262-
Psetfield (lbl.lbl_pos, Fld_record_inline_set lbl.lbl_name)
1262+
Psetfield (lbl.lbl_pos, !Lambda.fld_record_inline_set lbl)
12631263
| Record_unboxed _ -> assert false
12641264
| Record_extension ->
12651265
Psetfield
1266-
(lbl.lbl_pos + 1, Fld_record_extension_set lbl.lbl_name)
1266+
(lbl.lbl_pos + 1, !Lambda.fld_record_extension_set lbl)
12671267
in
12681268
Lsequence
12691269
(Lprim (upd, [ Lvar copy_id; transl_exp expr ], loc), cont)

jscomp/test/as_inline_record_test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)