@@ -404623,25 +404623,32 @@ let app_exp_mapper
404623
404623
]}
404624
404624
*)
404625
404625
| Some {op = "#="; loc; args = [obj; arg]} ->
404626
- begin match view_as_app obj ["##"] with
404627
- | Some { args = [obj; {
404628
- pexp_desc =
404629
- Pexp_ident {txt = Lident name}
404626
+ let gen_assignment obj name name_loc =
404627
+ sane_property_name_check name_loc name;
404628
+ Exp.constraint_ ~loc
404629
+ { e with
404630
+ pexp_desc =
404631
+ Ast_uncurry_apply.method_apply loc self obj
404632
+ (name ^ Literals.setter_suffix) [Nolabel,arg] }
404633
+ (Ast_literal.type_unit ~loc ()) in
404634
+ begin match obj.pexp_desc with
404635
+ | Pexp_send (obj , {txt = name; loc = name_loc})
404636
+ -> gen_assignment obj name name_loc
404637
+ | _ ->
404638
+ match view_as_app obj ["##"] with
404639
+ | Some { args = [obj; {
404640
+ pexp_desc =
404641
+ Pexp_ident {txt = Lident name}
404630
404642
| Pexp_constant (
404631
- Pconst_string
404632
- (name, None)); pexp_loc
404633
- }
404634
- ]
404635
- }
404636
- ->
404637
- sane_property_name_check pexp_loc name;
404638
- Exp.constraint_ ~loc
404639
- { e with
404640
- pexp_desc =
404641
- Ast_uncurry_apply.method_apply loc self obj
404642
- (name ^ Literals.setter_suffix) [Nolabel,arg] }
404643
- (Ast_literal.type_unit ~loc ())
404644
- | _ -> assert false
404643
+ Pconst_string
404644
+ (name, None)); pexp_loc = name_loc
404645
+ }
404646
+ ]
404647
+ }
404648
+ ->
404649
+ gen_assignment obj name name_loc
404650
+ | _ ->
404651
+ Location.raise_errorf ~loc "invalid #= assignment"
404645
404652
end
404646
404653
| Some { op = "|."; loc; } ->
404647
404654
Location.raise_errorf ~loc
0 commit comments