summary refs log tree commit diff stats
path: root/tests/pragmas
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-10-09 19:58:23 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-10-09 19:58:23 +0200
commit33458894da13da7134604639c129273bfb0cb1c1 (patch)
tree76ed110300cb8cb104f4c51730650ce65a83ad79 /tests/pragmas
parentee14ace5d3f3ede9d47d60bd415e46a3fb121fb2 (diff)
downloadNim-33458894da13da7134604639c129273bfb0cb1c1.tar.gz
Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448
Fixes #4384
Diffstat (limited to 'tests/pragmas')
-rw-r--r--tests/pragmas/foobar.nim3
-rw-r--r--tests/pragmas/t4384.nim3
-rw-r--r--tests/pragmas/t6448.nim16
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/pragmas/foobar.nim b/tests/pragmas/foobar.nim
new file mode 100644
index 000000000..46032e187
--- /dev/null
+++ b/tests/pragmas/foobar.nim
@@ -0,0 +1,3 @@
+import macros
+macro async*(body: untyped): untyped =
+  return newStmtList()
diff --git a/tests/pragmas/t4384.nim b/tests/pragmas/t4384.nim
new file mode 100644
index 000000000..e6b193f79
--- /dev/null
+++ b/tests/pragmas/t4384.nim
@@ -0,0 +1,3 @@
+macro testMacro(body: untyped): untyped = discard
+macro testMacro(s: string, body: untyped): untyped = discard
+proc foo() {.testMacro: "foo".} = discard
diff --git a/tests/pragmas/t6448.nim b/tests/pragmas/t6448.nim
new file mode 100644
index 000000000..61e4a35d9
--- /dev/null
+++ b/tests/pragmas/t6448.nim
@@ -0,0 +1,16 @@
+discard """
+  line: 9
+  errormsg: '''ambiguous call; both foobar.async'''
+"""
+
+import foobar
+import asyncdispatch, macros
+
+proc bar() {.async.} =
+  echo 42
+
+proc foo() {.async.} = 
+  await bar()
+
+asyncCheck foo()
+runForever()