diff options
| author | Matthieu Sozeau | 2016-05-25 15:24:22 +0200 |
|---|---|---|
| committer | Matthieu Sozeau | 2016-07-06 14:38:05 +0200 |
| commit | f46f4ecec94953930fca6bbbc9fdb83a7a1025fc (patch) | |
| tree | dd97bfe2b1bd0173f172488091998802aad6d41f | |
| parent | f8a5cb590352a617de38fdd8ba5ffff7691d9841 (diff) | |
Fixed bug #4622.
| -rw-r--r-- | test-suite/bugs/closed/4622.v | 24 | ||||
| -rw-r--r-- | test-suite/success/primitiveproj.v | 4 |
2 files changed, 26 insertions, 2 deletions
diff --git a/test-suite/bugs/closed/4622.v b/test-suite/bugs/closed/4622.v new file mode 100644 index 0000000000..ffa478cb87 --- /dev/null +++ b/test-suite/bugs/closed/4622.v @@ -0,0 +1,24 @@ +Set Primitive Projections. + +Record foo : Type := bar { x : unit }. + +Goal forall t u, bar t = bar u -> t = u. +Proof. + intros. + injection H. + trivial. +Qed. +(* Was: Error: Pattern-matching expression on an object of inductive type foo has invalid information. *) + +(** Dependent pattern-matching is ok on this one as it has eta *) +Definition baz (x : foo) := + match x as x' return x' = x' with + | bar u => eq_refl + end. + +Inductive foo' : Type := bar' {x' : unit; y: foo'}. +(** Dependent pattern-matching is not ok on this one *) +Fail Definition baz' (x : foo') := + match x as x' return x' = x' with + | bar' u y => eq_refl + end. diff --git a/test-suite/success/primitiveproj.v b/test-suite/success/primitiveproj.v index 473d37eb36..2fa7704941 100644 --- a/test-suite/success/primitiveproj.v +++ b/test-suite/success/primitiveproj.v @@ -47,9 +47,9 @@ Check _.(next) : option Y. Lemma eta_ind (y : Y) : y = Build_Y y.(next). Proof. Fail reflexivity. Abort. -Record Fdef := { Fa : nat ; Fb := Fa; Fc : nat }. +Inductive Fdef := { Fa : nat ; Fb := Fa; Fc : Fdef }. -Scheme Fdef_rec := Induction for Fdef Sort Prop. +Fail Scheme Fdef_rec := Induction for Fdef Sort Prop. (* Rules for parsing and printing of primitive projections and their eta expansions. |
