diff options
Diffstat (limited to 'tests/macros/tgetimpl.nim')
-rw-r--r-- | tests/macros/tgetimpl.nim | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/macros/tgetimpl.nim b/tests/macros/tgetimpl.nim index 715c969f3..a546271ff 100644 --- a/tests/macros/tgetimpl.nim +++ b/tests/macros/tgetimpl.nim @@ -1,7 +1,7 @@ discard """ msg: '''"muhaha" proc poo(x, y: int) = - let y = x + let y = x echo ["poo"]''' """ @@ -16,14 +16,13 @@ proc poo(x, y: int) = macro m(x: typed): untyped = echo repr x.getImpl - result = x -discard m foo -discard m poo +m(foo) +m(poo) #------------ -macro checkOwner(x: typed, check_id: static[int]): untyped = +macro checkOwner(x: typed, check_id: static[int]): untyped = let sym = case check_id: of 0: x of 1: x.getImpl.body[0][0][0] @@ -32,11 +31,11 @@ macro checkOwner(x: typed, check_id: static[int]): untyped = else: x result = newStrLitNode($sym.owner.symKind) -macro isSameOwner(x, y: typed): untyped = - result = +macro isSameOwner(x, y: typed): untyped = + result = if x.owner == y.owner: bindSym"true" else: bindSym"false" - + static: doAssert checkOwner(foo, 0) == "nskModule" |