lean4-htt/tests/lean/run/coe_univ_bug.lean
2017-03-09 18:41:19 -08:00

20 lines
429 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.val s⟩
def g {n : nat} (v : below n) : nat :=
v + 1
#print g