diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macros/tclosuremacro.nim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/macros/tclosuremacro.nim b/tests/macros/tclosuremacro.nim index 5c41c317a..2a7847b9e 100644 --- a/tests/macros/tclosuremacro.nim +++ b/tests/macros/tclosuremacro.nim @@ -71,3 +71,16 @@ m: echo "yes" sugarWithPragma() {.m.} => echo "sugarWithPragma called" + +typedParamAndPragma(x, y: int) {.used.} -> int => x + y +doAssert typedParamAndPragma(1, 2) == 3 + +type + Bot = object + call: proc (): string {.noSideEffect.} + +var myBot = Bot() +myBot.call = () {.noSideEffect.} => "I'm a bot." +doAssert myBot.call() == "I'm a bot." + + |