lean4-htt/tests/lean/coeAttr1.lean
Scott Morrison 696b08dca2
chore: upstream Std.Tactic.CoeExt to Lean.Elab.CoeExt (#3280)
Moves the `@[coe]` attribute and associated elaborators/delaborators
from Std to Lean.

---------

Co-authored-by: Leonardo de Moura <leomoura@amazon.com>
2024-02-09 04:55:49 +00:00

11 lines
157 B
Text

@[coe] def f (n : Nat) : String :=
toString n
#check f 10
instance : Coe Nat String where
coe := f
def g (n : String) := n
#check fun x : Nat => g x