Debian Codegraph @

test-suite/output/ltac2_check_globalize.v

raw
1 Require Import Ltac2.Ltac2.
2
3 Unset Ltac2 Typed Notations.
4
5 Ltac2 Notation "foo" := ().
6
7 Ltac2 Globalize foo.
8
9 Ltac2 Check foo.
10
11 Ltac2 Check (fun x => x : 'a -> 'a).
12
13 Ltac2 Globalize (() ()).
14
15 Ltac2 Notation "bar" := (1,2).
16
17 (* check that CTacApp nodes don't get merged or that we handle merging them correctly. *)
18 Ltac2 Globalize bar 3.
19
20 Ltac2 Globalize let x := () in x ().
21
22 Fail Ltac2 Check let x := () in x ().
23
24 Ltac2 Notation "complicated_typing" x(tactic) :=
25 let _ := x 1 in
26 let _ := x "" in
27 ().
28
29 Ltac2 Globalize complicated_typing (fun x => x).
30
31 Ltac2 Check complicated_typing (fun x => x).
32
33 Ltac2 Globalize
34 let accu := { contents := [] } in
35 complicated_typing (fun x => accu.(contents) := x :: accu.(contents));
36 accu.(contents).
37
38 Fail Ltac2 Check
39 let accu := { contents := [] } in
40 complicated_typing (fun x => accu.(contents) := x :: accu.(contents));
41 accu.(contents).
42
43 Ltac2 Globalize lazy_match! goal with
44 | [h: _ |- _] => (* lots of code... *) Std.clear h (* more code... *)
45 | [|- _] => (* lots of code... *) ()
46 end.
47
48 Ltac2 Globalize constr:(ltac2:(foo)).