Debian Codegraph @

test-suite/ltac2/quot.v

raw
1 Require Import Ltac2.Ltac2.
2
3 (** Test for quotations *)
4
5 Ltac2 ref0 () := reference:(&x).
6 Ltac2 ref1 () := reference:(nat).
7 Ltac2 ref2 () := reference:(Datatypes.nat).
8 Fail Ltac2 ref () := reference:(i_certainly_dont_exist).
9 Fail Ltac2 ref () := reference:(And.Me.neither).
10
11 Goal True.
12 Proof.
13 let x := constr:(I) in
14 let y := constr:((fun z => z) $x) in
15 Control.refine (fun _ => y).
16 Qed.
17
18 Goal True.
19 Proof.
20 (** Here, Ltac2 should not put its variables in the same environment as
21 Ltac1 otherwise the second binding fails as x is bound but not an
22 ident. *)
23 let x := constr:(I) in
24 let y := constr:((fun x => x) $x) in
25 Control.refine (fun _ => y).
26 Qed.