aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/output/Cases.v
diff options
context:
space:
mode:
authorGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-01-16 10:10:43 +0000
committerGravatar pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-01-16 10:10:43 +0000
commitbc37c572cae76b6365f86eb5ebc05905b78577cf (patch)
treec23e2244d8c5a43969c2387c055888427678390b /test-suite/output/Cases.v
parent42a1588c7b1d38df5192c80b62b32dbafce07d55 (diff)
Parameters in pattern first step.
In interp/constrintern.ml, '_' for constructor parameter are required if you use AppExpl ('@Constr') and added in order to be erased at the last time if you do not use '@'. It makes the use of notation in pattern more permissive. For example, -8<------ Inductive I (A: Type) : Type := C : A -> I A. Notation "x <: T" := (C T x) (at level 38). Definition uncast A (x : I A) := match x with | x <: _ => x end. -8<------ was forbidden. Backward compatibility is strictly preserved expect for syntactic definitions: While defining "Notation SOME = @Some", SOME had a special treatment and used to be an alias of Some in pattern. It is now uniformly an alias of @Some ('_' must be provided for parameters). In interp/constrextern.ml, except if all the parameters are implicit and all the arguments explicit (This covers all the cases of the test-suite), pattern are generated with AppExpl (id est '@') (so with '_' for parameters) in order to become compatible in any case with future behavior. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14909 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'test-suite/output/Cases.v')
-rw-r--r--test-suite/output/Cases.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/test-suite/output/Cases.v b/test-suite/output/Cases.v
index b63375867..505418b14 100644
--- a/test-suite/output/Cases.v
+++ b/test-suite/output/Cases.v
@@ -34,6 +34,18 @@ Fixpoint foo (A:Type) (l:list A) : option A :=
Print foo.
+(* Accept and use notation with binded parameters *)
+
+Inductive I (A: Type) : Type := C : A -> I A.
+Notation "x <: T" := (C T x) (at level 38).
+
+Definition uncast A (x : I A) :=
+match x with
+ | x <: _ => x
+end.
+
+Print uncast.
+
(* Do not duplicate the matched term *)
Axiom A : nat -> bool.