aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2016-06-11 18:09:01 -0400
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-09-26 23:43:50 +0200
commitf8745b1dbc87a8fee4943a91f517dc2afcd7804b (patch)
tree87db013524bd5223da6df924d6d283829cb5ea02
parent7bc04ff2cc9d511c4b8552a3e5f9ad416917fb95 (diff)
Unbreak Ltac [ | .. | ] notation in -compat 8.5
Importing VectorNotations breaks `; []`. So we make sure it's not imported by defualt. Some files might be required to `Import VectorDef.VectorNotations` rather than just `Import VectorNotations`.
-rw-r--r--test-suite/bugs/closed/4785.v23
-rw-r--r--theories/Compat/Coq85.v3
2 files changed, 22 insertions, 4 deletions
diff --git a/test-suite/bugs/closed/4785.v b/test-suite/bugs/closed/4785.v
index b844af68a..14af2d91d 100644
--- a/test-suite/bugs/closed/4785.v
+++ b/test-suite/bugs/closed/4785.v
@@ -1,4 +1,8 @@
-Require Import Coq.Lists.List Coq.Vectors.Vector.
+Require Coq.Lists.List Coq.Vectors.Vector.
+Require Coq.Compat.Coq85.
+
+Module A.
+Import Coq.Lists.List Coq.Vectors.Vector.
Import ListNotations.
Check [ ]%list : list _.
Import VectorNotations ListNotations.
@@ -8,6 +12,10 @@ Check []%vector : Vector.t _ _.
Check [ ]%list : list _.
Check []%list : list _.
+Goal True.
+ idtac; []. (* Check that vector notations don't break the [ | .. | ] syntax of Ltac *)
+Abort.
+
Inductive mylist A := mynil | mycons (x : A) (xs : mylist A).
Delimit Scope mylist_scope with mylist.
Bind Scope mylist_scope with mylist.
@@ -18,9 +26,20 @@ Notation " [ ] " := mynil (format "[ ]") : mylist_scope.
Notation " [ x ] " := (mycons x nil) : mylist_scope.
Notation " [ x ; y ; .. ; z ] " := (mycons x (mycons y .. (mycons z nil) ..)) : mylist_scope.
-Require Import Coq.Compat.Coq85.
+Import Coq.Compat.Coq85.
+Locate Module VectorNotations.
+Import VectorDef.VectorNotations.
Check []%vector : Vector.t _ _.
Check []%mylist : mylist _.
Check [ ]%mylist : mylist _.
Check [ ]%list : list _.
+End A.
+
+Module B.
+Import Coq.Compat.Coq85.
+
+Goal True.
+ idtac; []. (* Check that importing the compat file doesn't break the [ | .. | ] syntax of Ltac *)
+Abort.
+End B.
diff --git a/theories/Compat/Coq85.v b/theories/Compat/Coq85.v
index 6e495b05c..54aeeaa11 100644
--- a/theories/Compat/Coq85.v
+++ b/theories/Compat/Coq85.v
@@ -32,6 +32,7 @@ Require Coq.Vectors.VectorDef.
Module Export Coq.
Module Export Vectors.
Module VectorDef.
+Export Coq.Vectors.VectorDef.
Module VectorNotations.
Export Coq.Vectors.VectorDef.VectorNotations.
Notation "[]" := (VectorDef.nil _) : vector_scope.
@@ -39,5 +40,3 @@ End VectorNotations.
End VectorDef.
End Vectors.
End Coq.
-Export Vectors.VectorDef.VectorNotations.
-Close Scope vector_scope. (* vector_scope is not opened by default *)