Skip to content

Commit 7c9d321

Browse files
committed
fix Elpi Typecheck program
1 parent c8bff49 commit 7c9d321

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

_CoqProject.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ tests/test_link_order_import3.v
5555
tests/test_query_extra_dep.v
5656
tests/test_toposort.v
5757
tests/test_synterp.v
58+
tests/test_checker.v

src/coq_elpi_vernacular.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ let set_current_program n =
286286
current_program := Some n
287287

288288
let typecheck_program ?program () =
289-
match !current_program with
289+
match Option.append program !current_program with
290290
| None -> ()
291291
| Some program ->
292292
let elpi = P.ensure_initialized () in

tests/test_checker.v

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
From elpi Require Import elpi.
2+
3+
Elpi Command foo.
4+
Elpi Accumulate lp:{{
5+
pred p i:int.
6+
p 0 0.
7+
8+
}}.
9+
Fail Elpi Typecheck.
10+
11+
Elpi Command bar.
12+
Elpi Accumulate lp:{{
13+
pred p i:int.
14+
p 0.
15+
16+
}}.
17+
Elpi Typecheck.
18+
19+
Fail Elpi Typecheck foo.

0 commit comments

Comments
 (0)