Skip to content

Commit aff0dec

Browse files
committed
Turn off apply nested coercion.
1 parent eeefa39 commit aff0dec

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

compiler/ml/translmod.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ let rec apply_coercion loc strict (restr : Typedtree.module_coercion) arg =
8787

8888
and apply_coercion_result loc strict funct params args cc_res =
8989
match cc_res with
90-
| Tcoerce_functor (cc_arg, cc_res) ->
91-
let param = Ident.create "funarg" in
92-
let arg = apply_coercion loc Alias cc_arg (Lvar param) in
93-
apply_coercion_result loc strict funct (param :: params) (arg :: args)
94-
cc_res
90+
(* | Tcoerce_functor (cc_arg, cc_res) ->
91+
let param = Ident.create "funarg" in
92+
let arg = apply_coercion loc Alias cc_arg (Lvar param) in
93+
apply_coercion_result loc strict funct (param :: params) (arg :: args)
94+
cc_res *)
9595
| _ ->
9696
Lambda.name_lambda strict funct (fun id ->
9797
Lfunction

tests/tests/src/functors.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,12 @@ function F2(X) {
4040
}
4141

4242
let M = {
43-
F: (funarg, funarg$1) => {
44-
let Y = {
45-
foo: funarg$1.foo
46-
};
47-
let cow = x => Y.foo(funarg.foo(x));
48-
let sheep = x => 1 + cow(x) | 0;
43+
F: funarg => (funarg$1 => {
44+
let sheep = x => 1 + funarg$1.foo(funarg.foo(x)) | 0;
4945
return {
5046
sheep: sheep
5147
};
52-
}
48+
})
5349
};
5450

5551
export {

tests/tests/src/functors_one_arg_at_a_time.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let M = {
2121
let EQ = Eq({})({});
2222

2323
let MF = {
24-
F: (funarg, funarg$1) => ({})
24+
F: funarg => (funarg => ({}))
2525
};
2626

2727
function UseF(X) {

0 commit comments

Comments
 (0)