aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/output/Cases.v
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-10-19 17:20:06 +0200
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-10-19 17:21:09 +0200
commit00978cddf6e2da71892de6362e69c372429e159f (patch)
tree1f89494f1e08bcabd4924ebbe1506bc86c843a3e /test-suite/output/Cases.v
parent21e1d501e17c9989d9cd689988a510e1864f817a (diff)
Test for variant of #5142 (good error message on pattern-matching failure).
Diffstat (limited to 'test-suite/output/Cases.v')
-rw-r--r--test-suite/output/Cases.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/test-suite/output/Cases.v b/test-suite/output/Cases.v
index 1903753cc..407489642 100644
--- a/test-suite/output/Cases.v
+++ b/test-suite/output/Cases.v
@@ -89,3 +89,20 @@ Fail Definition gadt_id T (x: gadt T) : gadt T :=
match x with
| gadtNat n => gadtNat n
end.
+
+(* A variant of #5142 (see Satrajit Roy's example on coq-club (Oct 17, 2016)) *)
+
+Inductive type:Set:=Nat.
+Inductive tbinop:type->type->type->Set:= TPlus : tbinop Nat Nat Nat.
+Inductive texp:type->Set:=
+ |TNConst:nat->texp Nat
+ |TBinop:forall t1 t2 t, tbinop t1 t2 t->texp t1->texp t2->texp t.
+Definition typeDenote(t:type):Set:= match t with Nat => nat end.
+
+(* We expect a failure on TBinop *)
+Fail Fixpoint texpDenote t (e:texp t):typeDenote t:=
+ match e with
+ | TNConst n => n
+ | TBinop t1 t2 _ b e1 e2 => O
+ end.
+