lean4-htt/tests/lean/run/coe_univ_bug.lean
Leonardo de Moura bf9f7560f7 feat(frontends/lean): (Type u) can't be a proposition
(Type u)  is the old (Type (u+1))
(PType u) is the old (Type u)
Type*     is the old (Type (_+1))
PType*    is the old Type*

The stdlib can be compiled, but we still have > 70 broken tests

See discussion at #1341
2017-01-30 11:54:00 -08:00

20 lines
431 B
Text

open nat
def below (n : nat) : nat → Prop :=
λ i, i < n
def f {n : nat} (v : subtype (below n)) : nat :=
v + 1
universe variable u
instance pred2subtype {A : Type u} : has_coe_to_sort (A → Prop) :=
⟨Type u, (λ p : A → Prop, subtype p)⟩
instance coesubtype {A : Type u} {p : A → Prop} : has_coe (@coe_sort _ pred2subtype p) A :=
⟨λ s, subtype.elt_of s⟩
def g {n : nat} (v : below n) : nat :=
v + 1
print g