lean4-htt/tests/lean/run/overloaded.lean
2020-10-25 09:16:38 -07:00

22 lines
385 B
Text

def A.x : Nat := 10
def B.x : String := "hello"
def f (a : Nat) := a + 1
def g (s : String) := s ++ " world"
open A
open B
#check f x
#check g x
macro "foo!" x:term : term => `($x + 1)
macro "foo!" x:term : term => `($x ++ " world")
#check f (foo! 1)
#check g (foo! "hello")
macro "bla!" : term => `((1 : Nat))
macro "bla!" : term => `("hello world")
#check f bla!
#check g bla!