mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
fixes #2372
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user