diff --git a/tests/func/good/closure_conversion.catala_en b/tests/func/good/closure_conversion.catala_en index f68cfe07..e869a0de 100644 --- a/tests/func/good/closure_conversion.catala_en +++ b/tests/func/good/closure_conversion.catala_en @@ -29,13 +29,13 @@ type Eoption = | ENone of unit | ESome of any type S_in = { x_in: bool; } type S = { z: integer; } -let topval closure_f : (closure_env, integer) → integer = +let topval closure_f1 : (closure_env, integer) → integer = λ (env: closure_env) (y: integer) → if (from_closure_env env).0 then y else - y let scope S (S_in: S_in {x_in: bool}): S {z: integer} = let get x : bool = S_in.x_in in let set f : ((closure_env, integer) → integer, closure_env) = - (closure_f, to_closure_env (x)) + (closure_f1, to_closure_env (x)) in let set z : integer = f.0 f.1 -1 in return { S z = z; } @@ -81,7 +81,7 @@ let scope S2Use } = let set fun : ((closure_env, integer) → decimal, closure_env) = - (closure_fun, to_closure_env ()) + (closure_fun1, to_closure_env ()) in let set o : (S2 { @@ -95,14 +95,14 @@ let scope S2Use (let result : S2 = S2 { S2_in cfun2_in = fun; } in { S2 dummy = result.dummy; - cfun2 = (closure_o, to_closure_env (result)); + cfun2 = (closure_o1, to_closure_env (result)); }, let result : S2 = - S2 { S2_in cfun2_in = (closure_o, to_closure_env ()); } + S2 { S2_in cfun2_in = (closure_o3, to_closure_env ()); } in { S2 dummy = result.dummy; - cfun2 = (closure_o, to_closure_env (result)); + cfun2 = (closure_o2, to_closure_env (result)); }) in return { S2Use o = o; } diff --git a/tests/func/good/closure_return.catala_en b/tests/func/good/closure_return.catala_en index 36e54788..e3cfd85e 100644 --- a/tests/func/good/closure_return.catala_en +++ b/tests/func/good/closure_return.catala_en @@ -27,7 +27,7 @@ type Eoption = | ENone of unit | ESome of any type S_in = { x_in: bool; } type S = { f: ((closure_env, integer) → integer, closure_env); } -let topval closure_f : (closure_env, integer) → integer = +let topval closure_f1 : (closure_env, integer) → integer = λ (env: closure_env) (y: integer) → if (from_closure_env env).0 then y else - y let scope S @@ -36,7 +36,7 @@ let scope S = let get x : bool = S_in.x_in in let set f : ((closure_env, integer) → integer, closure_env) = - (closure_f, to_closure_env (x)) + (closure_f1, to_closure_env (x)) in return { S f = f; } diff --git a/tests/func/good/closure_through_scope.catala_en b/tests/func/good/closure_through_scope.catala_en index 24ce4ab3..c0a2036a 100644 --- a/tests/func/good/closure_through_scope.catala_en +++ b/tests/func/good/closure_through_scope.catala_en @@ -33,7 +33,7 @@ $ catala Typecheck --check-invariants $ catala Lcalc -s T --avoid-exceptions -O --closure-conversion let scope T (T_in: T_in): T {y: integer} = let set s : S {f: ((closure_env, integer) → integer, closure_env)} = - { S f = (closure_s, to_closure_env ()); } + { S f = (closure_s1, to_closure_env ()); } in let set y : integer = let code_and_env : ((closure_env, integer) → integer, closure_env) = diff --git a/tests/func/good/scope_call_func_struct_closure.catala_en b/tests/func/good/scope_call_func_struct_closure.catala_en index b940e448..def85b5f 100644 --- a/tests/func/good/scope_call_func_struct_closure.catala_en +++ b/tests/func/good/scope_call_func_struct_closure.catala_en @@ -72,7 +72,7 @@ type SubFoo2 = { type Foo_in = { b_in: ((closure_env, unit) → eoption bool, closure_env); } type Foo = { z: integer; } -let topval closure_y : (closure_env, integer) → integer = +let topval closure_y1 : (closure_env, integer) → integer = λ (env: closure_env) (z: integer) → (from_closure_env env).0 + z let scope SubFoo1 @@ -84,10 +84,10 @@ let scope SubFoo1 = let get x : integer = SubFoo1_in.x_in in let set y : ((closure_env, integer) → integer, closure_env) = - (closure_y, to_closure_env (x)) + (closure_y1, to_closure_env (x)) in return { SubFoo1 x = x; y = y; } -let topval closure_y : (closure_env, integer) → integer = +let topval closure_y1 : (closure_env, integer) → integer = λ (env: closure_env) (z: integer) → let env1 : (integer, integer) = from_closure_env env in ((env1.1 + env1.0 + z)) @@ -101,16 +101,16 @@ let scope SubFoo2 let get x1 : integer = SubFoo2_in.x1_in in let get x2 : integer = SubFoo2_in.x2_in in let set y : ((closure_env, integer) → integer, closure_env) = - (closure_y, to_closure_env (x2, x1)) + (closure_y1, to_closure_env (x2, x1)) in return { SubFoo2 x1 = x1; y = y; } -let topval closure_r : (closure_env, integer) → integer = +let topval closure_r2 : (closure_env, integer) → integer = λ (env: closure_env) (param0: integer) → let code_and_env : ((closure_env, integer) → integer, closure_env) = (from_closure_env env).0.y in code_and_env.0 code_and_env.1 param0 -let topval closure_r : (closure_env, integer) → integer = +let topval closure_r1 : (closure_env, integer) → integer = λ (env: closure_env) (param0: integer) → let code_and_env : ((closure_env, integer) → integer, closure_env) = (from_closure_env env).0.y @@ -139,7 +139,7 @@ let scope Foo if b then let f : SubFoo1 = let result : SubFoo1 = SubFoo1 { SubFoo1_in x_in = 10; } in - { SubFoo1 x = result.x; y = (closure_r, to_closure_env (result)); } + { SubFoo1 x = result.x; y = (closure_r1, to_closure_env (result)); } in { Result r = f.y; q = f.x; } else @@ -147,7 +147,10 @@ let scope Foo let result : SubFoo2 = SubFoo2 { SubFoo2_in x1_in = 10; x2_in = 10; } in - { SubFoo2 x1 = result.x1; y = (closure_r, to_closure_env (result)); } + { SubFoo2 + x1 = result.x1; + y = (closure_r2, to_closure_env (result)); + } in { Result r = f.y; q = f.x1; } in