diff options
| author | Hugo Herbelin | 2016-10-19 17:20:06 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2016-10-19 17:21:09 +0200 |
| commit | 00978cddf6e2da71892de6362e69c372429e159f (patch) | |
| tree | 1f89494f1e08bcabd4924ebbe1506bc86c843a3e /test-suite | |
| parent | 21e1d501e17c9989d9cd689988a510e1864f817a (diff) | |
Test for variant of #5142 (good error message on pattern-matching failure).
Diffstat (limited to 'test-suite')
| -rw-r--r-- | test-suite/output/Cases.out | 13 | ||||
| -rw-r--r-- | test-suite/output/Cases.v | 17 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test-suite/output/Cases.out b/test-suite/output/Cases.out index 95fcd362ef..8ce6f9795c 100644 --- a/test-suite/output/Cases.out +++ b/test-suite/output/Cases.out @@ -59,3 +59,16 @@ end The command has indeed failed with message: Non exhaustive pattern-matching: no clause found for pattern gadtTy _ _ +The command has indeed failed with message: +In environment +texpDenote : forall t : type, texp t -> typeDenote t +t : type +e : texp t +t1 : type +t2 : type +t0 : type +b : tbinop t1 t2 t0 +e1 : texp t1 +e2 : texp t2 +The term "0" has type "nat" while it is expected to have type + "typeDenote t0". diff --git a/test-suite/output/Cases.v b/test-suite/output/Cases.v index 1903753cc5..4074896420 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. + |
