summary refs log tree commit diff stats
path: root/tests/macros/tclosuremacro.nim
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2020-12-01 14:01:36 +0300
committerGitHub <noreply@github.com>2020-12-01 12:01:36 +0100
commit1d1b3f79fdccfdd359781dbde3c5aea3b67bf05b (patch)
tree4efaca640470cd2eff50b1ffe4cbdf3f6682e559 /tests/macros/tclosuremacro.nim
parent2e4b6b94e675a7de96fcf2b3e8ed4224dccd5747 (diff)
downloadNim-1d1b3f79fdccfdd359781dbde3c5aea3b67bf05b.tar.gz
fix broken => for typed procs with pragmas (#16190)
* fix broken => for typed procs with pragmas

* add more sugar tests

* add ending quote
Diffstat (limited to 'tests/macros/tclosuremacro.nim')
-rw-r--r--tests/macros/tclosuremacro.nim13
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."
+
+