summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/semexprs.nim4
-rw-r--r--tests/typerel/temptynode.nim16
2 files changed, 18 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 052098864..5aac1c2ac 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -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)
diff --git a/tests/typerel/temptynode.nim b/tests/typerel/temptynode.nim
new file mode 100644
index 000000000..91e45f3ca
--- /dev/null
+++ b/tests/typerel/temptynode.nim
@@ -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())