@@ -393775,8 +393775,7 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
393775393775 Lam.for_ id (convert_aux from_) (convert_aux to_) dir (convert_aux loop)
393776393776 | Lassign (id, body) ->
393777393777 Lam.assign id (convert_aux body)
393778- | Lsend (Public(Some name), _, obj, _, loc) ->
393779- (* Format.fprintf Format.err_formatter "%a@." Printlambda.lambda b ; *)
393778+ | Lsend (Public(Some name), _, obj, meth_args, loc) ->
393780393779 let obj = convert_aux obj in
393781393780 let args = [obj] in
393782393781 let setter = Ext_string.ends_with name Literals.setter_suffix in
@@ -393786,8 +393785,11 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
393786393785 (String.sub name 0
393787393786 (String.length name - Literals.setter_suffix_len))
393788393787 else Lam_methname.translate name in
393789- prim ~primitive:(Pjs_unsafe_downgrade {name = property; setter})
393790- ~args loc
393788+ let new_obj = prim ~primitive:(Pjs_unsafe_downgrade {name = property; setter})
393789+ ~args loc in
393790+ if meth_args = [] then new_obj
393791+ else Lam.apply new_obj
393792+ (Ext_list.map meth_args convert_aux) {ap_loc = loc; ap_inlined = Default_inline; ap_status = App_na}
393791393793
393792393794 | Lsend _ -> assert false
393793393795 | Levent _ ->
@@ -393961,8 +393963,8 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
393961393963
393962393964
393963393965 we should not remove it immediately, since we have to be careful
393964- where it is used, it can be [exported], [Lvar] or [Lassign] etc
393965- The other common mistake is that
393966+ where it is used, it can be [exported], [Lvar] or [Lassign] etc
393967+ The other common mistake is that
393966393968 {[
393967393969 let x = y (* elimiated x/y*)
393968393970 let u = x (* eliminated u/x *)
@@ -393974,13 +393976,13 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) : Lam.t * Lam_module_i
393974393976 let x = y (* x/y *)
393975393977 let u = x (* u/y *)
393976393978 ]}
393977- This looks more correct, but lets be conservative here
393979+ This looks more correct, but lets be conservative here
393978393980
393979- global module inclusion {[ include List ]}
393980- will cause code like {[ let include =a Lglobal_module (list)]}
393981+ global module inclusion {[ include List ]}
393982+ will cause code like {[ let include =a Lglobal_module (list)]}
393981393983
393982- when [u] is global, it can not be bound again,
393983- it should always be the leaf
393984+ when [u] is global, it can not be bound again,
393985+ it should always be the leaf
393984393986*)
393985393987end
393986393988module Lam_pass_alpha_conversion : sig
0 commit comments