Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448 Fixes #4384
This commit is contained in:
parent
ee14ace5d3
commit
33458894da
8 changed files with 66 additions and 33 deletions
3
tests/pragmas/foobar.nim
Normal file
3
tests/pragmas/foobar.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import macros
|
||||
macro async*(body: untyped): untyped =
|
||||
return newStmtList()
|
||||
3
tests/pragmas/t4384.nim
Normal file
3
tests/pragmas/t4384.nim
Normal 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
16
tests/pragmas/t6448.nim
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue