summary refs log tree commit diff stats
path: root/tests
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
parentee14ace5d3f3ede9d47d60bd415e46a3fb121fb2 (diff)
downloadNim-33458894da13da7134604639c129273bfb0cb1c1.tar.gz
Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448
Fixes #4384
Diffstat (limited to 'tests')
-rw-r--r--tests/macros/tmsginfo.nim2
-rw-r--r--tests/pragmas/foobar.nim3
-rw-r--r--tests/pragmas/t4384.nim3
-rw-r--r--tests/pragmas/t6448.nim16
4 files changed, 23 insertions, 1 deletions
diff --git a/tests/macros/tmsginfo.nim b/tests/macros/tmsginfo.nim
index bf6c9d537..ebdce0155 100644
--- a/tests/macros/tmsginfo.nim
+++ b/tests/macros/tmsginfo.nim
@@ -1,6 +1,6 @@
 discard """
   nimout: '''tmsginfo.nim(21, 1) Warning: foo1 [User]
-tmsginfo.nim(22, 11) template/generic instantiation from here
+tmsginfo.nim(22, 13) template/generic instantiation from here
 tmsginfo.nim(15, 10) Warning: foo2 [User]
 tmsginfo.nim(23, 1) Hint: foo3 [User]
 tmsginfo.nim(19, 7) Hint: foo4 [User]
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()