Fix overload resolution for pragmas evaluation (#8902)

Fixes #6448
Fixes #4384
This commit is contained in:
LemonBoy 2018-10-09 19:58:23 +02:00 • committed by Andreas Rumpf
commit 33458894da
8 changed files with 66 additions and 33 deletions

View file

@ -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]

3
tests/pragmas/foobar.nim Normal file
View file

@ -0,0 +1,3 @@
import macros
macro async*(body: untyped): untyped =
return newStmtList()

3
tests/pragmas/t4384.nim Normal file
View file

@ -0,0 +1,3 @@
macro testMacro(body: untyped): untyped = discard
macro testMacro(s: string, body: untyped): untyped = discard
proc foo() {.testMacro: "foo".} = discard

16
tests/pragmas/t6448.nim Normal file
View file

@ -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()