diff options
| author | Pierre-Marie Pédrot | 2017-08-27 01:04:19 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2017-08-27 16:29:52 +0200 |
| commit | 9bbdee3c09c92654bb8937b9939a9b9c69c23d1d (patch) | |
| tree | b3d1c29ff58ce67cdf11123b48175098100f0354 /tests | |
| parent | 7f562a9539522e56004596a751758a08cee798b1 (diff) | |
Introducing rebindable toplevel definitions.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/rebind.v | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/rebind.v b/tests/rebind.v new file mode 100644 index 0000000000..270fdd0b69 --- /dev/null +++ b/tests/rebind.v @@ -0,0 +1,24 @@ +Require Import Ltac2.Ltac2 Ltac2.Notations. + +Ltac2 mutable foo () := constructor. + +Goal True. +Proof. +foo (). +Qed. + +Ltac2 Set foo := fun _ => fail. + +Goal True. +Proof. +Fail foo (). +constructor. +Qed. + +(** Not the right type *) +Fail Ltac2 Set foo := 0. + +Ltac2 bar () := (). + +(** Cannot redefine non-mutable tactics *) +Fail Ltac2 Set bar := fun _ => (). |
