| 1 |
Set Primitive Projections. |
| 2 |
|
| 3 |
Record foo : Type := bar { x : unit }. |
| 4 |
|
| 5 |
Goal forall t u, bar t = bar u -> t = u. |
| 6 |
Proof. |
| 7 |
intros. |
| 8 |
injection H. |
| 9 |
trivial. |
| 10 |
Qed. |
| 11 |
(* Was: Error: Pattern-matching expression on an object of inductive type foo has invalid information. *) |
| 12 |
|
| 13 |
(** Dependent pattern-matching is ok on this one as it has eta *) |
| 14 |
Definition baz (x : foo) := |
| 15 |
match x as x' return x' = x' with |
| 16 |
| bar u => eq_refl |
| 17 |
end. |
| 18 |
|
| 19 |
Inductive foo' : Type := bar' {x' : unit; y: foo'}. |
| 20 |
(** Dependent pattern-matching is not ok on this one *) |
| 21 |
Fail Definition baz' (x : foo') := |
| 22 |
match x as x' return x' = x' with |
| 23 |
| bar' u y => eq_refl |
| 24 |
end. |