fixes #2372
This commit is contained in:
parent
47271b094c
commit
4d20aafb5e
2 changed files with 13 additions and 1 deletions
|
|
@ -24,7 +24,7 @@ proc semFieldAccess(c: PContext, n: PNode, flags: TExprFlags = {}): PNode
|
|||
proc semOperand(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
||||
# same as 'semExprWithType' but doesn't check for proc vars
|
||||
result = semExpr(c, n, flags + {efOperand})
|
||||
if result.kind == nkEmpty:
|
||||
if result.kind == nkEmpty and result.typ.isNil:
|
||||
# do not produce another redundant error message:
|
||||
#raiseRecoverableError("")
|
||||
result = errorNode(c, n)
|
||||
|
|
|
|||
12
tests/macros/treturnsempty.nim
Normal file
12
tests/macros/treturnsempty.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
errormsg: "type mismatch"
|
||||
line: 11
|
||||
"""
|
||||
# bug #2372
|
||||
macro foo(dummy: int): stmt =
|
||||
discard
|
||||
|
||||
proc takeStr(s: string) = echo s
|
||||
|
||||
takeStr foo(12)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue