diff --git a/src/compiler/compiler.ml b/src/compiler/compiler.ml index e99d42b5b..983da7c71 100644 --- a/src/compiler/compiler.ml +++ b/src/compiler/compiler.ml @@ -1707,7 +1707,7 @@ end = struct | Impl(b,s,t) -> Impl(b,s,aux t) | Const(g,c) -> mkApp g c args | App(g,c,x,xs) -> mkApp g c (x :: xs @ args) - | Var _ + | Var(c,l) -> Var (c,l @ args) | Discard | Lam (_, _, _) | CData _ | Spill (_, _) | Cast (_, _) -> assert false and aux_last = function diff --git a/tests/sources/spill-var.elpi b/tests/sources/spill-var.elpi new file mode 100644 index 000000000..cab592190 --- /dev/null +++ b/tests/sources/spill-var.elpi @@ -0,0 +1,4 @@ + pred iterate i:(pred i:A, o:A), i:A, o:(list A). + iterate F X [X|XS] :- iterate F {F X} XS ; XS = []. + + main. \ No newline at end of file diff --git a/tests/suite/elpi_specific.ml b/tests/suite/elpi_specific.ml index ef053ddb6..a1c5f982a 100644 --- a/tests/suite/elpi_specific.ml +++ b/tests/suite/elpi_specific.ml @@ -159,6 +159,10 @@ let () = declare "spill_collision" ~description:"spilling under 2 pi named the same" () +let () = declare "spill-var" + ~source_elpi:"spill-var.elpi" + ~description:"spilling a var" + () let () = declare "block" ~source_elpi:"block.elpi"