mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Fix bug in bindlib use
This is a workaround (but corresponds to what was executed before) and means that we re-explore all exprs to look for free variables. The proper fix will be to store boxed_exprs inside scopes instead.
This commit is contained in:
parent
e925ec1795
commit
7bcafa4ead
@ -114,7 +114,7 @@ let get_body_mark scope_body =
|
||||
|
||||
let rec unfold_body_expr (ctx : decl_ctx) (scope_let : 'e scope_body_expr) =
|
||||
match scope_let with
|
||||
| Result e -> Expr.box e
|
||||
| Result e -> Expr.rebox e
|
||||
| ScopeLet
|
||||
{
|
||||
scope_let_kind = _;
|
||||
@ -124,7 +124,8 @@ let rec unfold_body_expr (ctx : decl_ctx) (scope_let : 'e scope_body_expr) =
|
||||
scope_let_pos;
|
||||
} ->
|
||||
let var, next = Bindlib.unbind scope_let_next in
|
||||
Expr.make_let_in var scope_let_typ (Expr.box scope_let_expr)
|
||||
Expr.make_let_in var scope_let_typ
|
||||
(Expr.rebox scope_let_expr)
|
||||
(unfold_body_expr ctx next)
|
||||
scope_let_pos
|
||||
|
||||
|
@ -20,7 +20,7 @@ Error coming from typechecking the following expression:
|
||||
--> tests/test_array/bad/fold_error.catala_en
|
||||
|
|
||||
10 | definition list_high_count equals number for m in list of (m >=$ $7)
|
||||
| ^
|
||||
| ^^^^
|
||||
+ Article
|
||||
|
||||
Type integer coming from expression:
|
||||
|
Loading…
Reference in New Issue
Block a user