test: issue reported by Reid

This commit is contained in:
Leonardo de Moura 2019-10-19 13:26:19 -07:00
parent 9160949df3
commit 1f8370c67d

View file

@ -0,0 +1,24 @@
structure constantFunction (α β : Type) :=
(f : α → β)
(h : ∀ a₁ a₂, f a₁ = f a₂)
instance {α β : Type} : HasCoeToFun (constantFunction α β) :=
⟨_, constantFunction.f⟩
def myFun {α : Type} : constantFunction α (Option α) :=
{ f := fun a => none,
h := fun a₁ a₂ => rfl }
def myFun' (α : Type) : constantFunction α (Option α) :=
{ f := fun a => none,
h := fun a₁ a₂ => rfl }
#check myFun 3
#check @myFun Nat 3 -- works
#check myFun' _ 3
#check myFun' Nat 3 -- works
#check ⇑myFun 3
#check ⇑(myFun' _) 3
#check ⇑(myFun' Nat) 3