Skip to content

Commit

Permalink
Fix nlocal in the generated Lambda for list comprehensions (ocaml-f…
Browse files Browse the repository at this point in the history
  • Loading branch information
antalsz authored Feb 1, 2023
1 parent afbcdf0 commit 8035026
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
4 changes: 3 additions & 1 deletion lambda/transl_list_comprehension.ml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ let rec translate_bindings
in
let body_func =
Lambda.lfunction
~kind:(Curried { nlocal = 1 }) (* The accumulator is local *)
~kind:(Curried { nlocal = 2 })
(* Only the accumulator is local, but since the function itself is
local, [nlocal] has to be equal to the number of parameters *)
~params:[element, element_kind; inner_acc, Pgenval]
~return:Pgenval
~attr:default_function_attribute
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
(* TEST
skip
* reason = "locals bug"
*)
(*
flags = "-extension comprehensions_experimental -extension immutable_arrays"
flags = "-extension comprehensions_experimental -extension immutable_arrays_experimental"
* expect
*)

Expand Down
4 changes: 0 additions & 4 deletions testsuite/tests/comprehensions/list_comprehensions_pure.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
(* TEST
skip
* reason = "locals bug"
*)
(*
flags = "-extension comprehensions_experimental"
* expect
*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
(* TEST
skip
* reason = "locals bug"
*)
(*
flags = "-extension comprehensions_experimental"
*)

Expand Down

0 comments on commit 8035026

Please sign in to comment.