diff --git a/compiler/lib-wasm/curry.ml b/compiler/lib-wasm/curry.ml index b6d5ab0cab..8c37ffbde6 100644 --- a/compiler/lib-wasm/curry.ml +++ b/compiler/lib-wasm/curry.ml @@ -359,6 +359,7 @@ module Make (Target : Target_sig.S) = struct } let f ~context = + let context = { context with other_fields = context.other_fields } in IntMap.iter (fun arity name -> let f = apply ~context ~arity ~name in @@ -388,5 +389,6 @@ module Make (Target : Target_sig.S) = struct (fun arity name -> let f = dummy ~context ~cps:true ~arity ~name in context.other_fields <- f :: context.other_fields) - context.cps_dummy_funs + context.cps_dummy_funs; + context end diff --git a/compiler/lib-wasm/curry.mli b/compiler/lib-wasm/curry.mli index efb4dc225c..bd710a9cc8 100644 --- a/compiler/lib-wasm/curry.mli +++ b/compiler/lib-wasm/curry.mli @@ -17,5 +17,5 @@ *) module Make (_ : Target_sig.S) : sig - val f : context:Code_generation.context -> unit + val f : context:Code_generation.context -> Code_generation.context end diff --git a/compiler/lib-wasm/generate.ml b/compiler/lib-wasm/generate.ml index fa196e8571..7df4c78efc 100644 --- a/compiler/lib-wasm/generate.ml +++ b/compiler/lib-wasm/generate.ml @@ -1442,7 +1442,7 @@ module Generate (Target : Target_sig.S) = struct toplevel_name, js_code let output ~context = - Curry.f ~context; + let context = Curry.f ~context in let imports = List.concat (List.map