lean4-htt/tests/lean/run/coeIssue3.lean
2020-01-28 15:52:04 -08:00

23 lines
512 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

structure Var : Type := (name : String)
instance Var.nameCoe : Coe String Var := ⟨Var.mk⟩
structure A : Type := (u : Unit)
structure B : Type := (u : Unit)
def a : A := A.mk ()
def b : B := B.mk ()
def Foo.chalk : A → List Var → Unit := λ _ _ => ()
def Bar.chalk : B → Unit := λ _ => ()
instance listCoe {α β} [Coe α β] : Coe (List α) (List β) :=
⟨fun as => as.map (fun a => coe a)⟩
new_frontend
open Foo
open Bar
#check Foo.chalk a ["foo"] -- works
#check chalk a ["foo"] -- works