mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
fixes #950
This commit is contained in:
@@ -24,10 +24,10 @@ 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 and result.typ.isNil:
|
||||
#if result.kind == nkEmpty and result.typ.isNil:
|
||||
# do not produce another redundant error message:
|
||||
#raiseRecoverableError("")
|
||||
result = errorNode(c, n)
|
||||
# result = errorNode(c, n)
|
||||
if result.typ != nil:
|
||||
# XXX tyGenericInst here?
|
||||
if result.typ.kind == tyVar: result = newDeref(result)
|
||||
|
||||
16
tests/typerel/temptynode.nim
Normal file
16
tests/typerel/temptynode.nim
Normal file
@@ -0,0 +1,16 @@
|
||||
discard """
|
||||
line: 16
|
||||
errormsg: "type mismatch: got (empty)"
|
||||
"""
|
||||
|
||||
# bug #950
|
||||
|
||||
import macros
|
||||
|
||||
proc blah(x: proc (a, b: int): int) =
|
||||
echo x(5, 5)
|
||||
|
||||
macro test(): stmt =
|
||||
result = newNimNode(nnkEmpty)
|
||||
|
||||
blah(test())
|
||||
Reference in New Issue
Block a user