mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Closure env is unit if no extra variable captured
This commit is contained in:
parent
6962761774
commit
9cf55b0edd
@ -204,12 +204,14 @@ let rec transform_closures_expr :
|
||||
[TAny, Expr.pos e]
|
||||
(Mark.get e))
|
||||
[
|
||||
Expr.etuple
|
||||
(List.map
|
||||
(fun extra_var ->
|
||||
Bindlib.box_var extra_var, binder_mark)
|
||||
extra_vars_list)
|
||||
m;
|
||||
(if extra_vars_list = [] then Expr.elit LUnit binder_mark
|
||||
else
|
||||
Expr.etuple
|
||||
(List.map
|
||||
(fun extra_var ->
|
||||
Bindlib.box_var extra_var, binder_mark)
|
||||
extra_vars_list)
|
||||
m);
|
||||
]
|
||||
(Mark.get e);
|
||||
])
|
||||
|
@ -39,7 +39,6 @@ scope Foo:
|
||||
|
||||
This test case is tricky because it creates a situation where the type of the
|
||||
two closures in Foo.r are different even with optimizations enabled.
|
||||
TODO fix this.
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Lcalc --avoid_exceptions -O --closure_conversion -s Foo
|
||||
|
Loading…
Reference in New Issue
Block a user