Почему следующее не проверяет тип (coq-8.5pl3)? Сопоставление с образцом, кажется, забывает, что u
и v
имеют один и тот же тип.
Inductive X : Type -> Type :=
| XId : forall a, X a -> X a
| XUnit : X unit.
Fixpoint f {a : Type} (x : X a) (y : X a) : a :=
match x, y with
| XId _ u, XId _ v => f u v
| XUnit, _ => tt
| _, XUnit => tt
end.
Сообщение об ошибке:
Error:
In environment
f : forall a : Type, X a -> X a -> a
a : Type
x : X a
y : X a
T : Type
u : X T
y0 : X T
T0 : Type
v : X T0
The term "v" has type "X T0"
while it is expected to have type "X T".