From d98876022661ac2bd2508832908d181c731af05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vouillon?= Date: Wed, 18 Jun 2025 11:17:17 +0200 Subject: [PATCH] Fix WAT debug output The helper functions for partial application where written twice. --- compiler/lib-wasm/curry.ml | 4 +++- compiler/lib-wasm/curry.mli | 2 +- compiler/lib-wasm/generate.ml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) 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