Added a last TODO and put big example under CI

This commit is contained in:
Denis Merigoux 2023-06-18 21:38:00 +02:00
parent b55d8c823b
commit 420348beda
2 changed files with 19 additions and 0 deletions

View File

@ -445,6 +445,11 @@ let rec hoist_closures_expr :
| EAbs { tys; _ } ->
(* this is the closure we want to hoist*)
let closure_var = Var.make ("closure_" ^ name_context) in
(* TODO: This will end up as a toplevel name. However for now we assume
toplevel names are unique, but this breaks this assertions and can lead
to name wrangling in the backends. We need to have a better system for
name disambiguation when for instance printing to Dcalc/Lcalc/Scalc but
also OCaml, Python, etc. *)
( [
{
name = closure_var;

View File

@ -168,6 +168,13 @@ $ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions
[RESULT] éligibilité = ESome true
```
```catala-test-inline
$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions -O --closure_conversion
[RESULT] Computation successful! Results:
[RESULT] montant_versé = ESome 246.23 €
[RESULT] éligibilité = ESome true
```
```catala-test-inline
$ catala Interpret -s Exemple2
[RESULT] Computation successful! Results:
@ -181,3 +188,10 @@ $ catala Interpret -s Exemple2 --avoid_exceptions
[RESULT] montant_versé = 230.63 €
[RESULT] éligibilité = true
```
```catala-test-inline
$ catala Interpret -s Exemple2 --avoid_exceptions -O --closure_conversion
[RESULT] Computation successful! Results:
[RESULT] montant_versé = 230.63 €
[RESULT] éligibilité = true
```