From f46f4ecec94953930fca6bbbc9fdb83a7a1025fc Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Wed, 25 May 2016 15:24:22 +0200 Subject: Fixed bug #4622. --- test-suite/bugs/closed/4622.v | 24 ++++++++++++++++++++++++ test-suite/success/primitiveproj.v | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 test-suite/bugs/closed/4622.v 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. -- cgit v1.2.3