From 9bbdee3c09c92654bb8937b9939a9b9c69c23d1d Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Sun, 27 Aug 2017 01:04:19 +0200 Subject: Introducing rebindable toplevel definitions. --- tests/rebind.v | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/rebind.v (limited to 'tests') 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 _ => (). -- cgit v1.2.3