summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semexprs.nim')
-rwxr-xr-xcompiler/semexprs.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index d403aeef1..3bbc0c71f 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -36,6 +36,15 @@ proc semExprWithType(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
     GlobalError(n.info, errExprXHasNoType, 
                 renderTree(result, {renderNoComments}))
 
+proc semExprNoDeref(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = 
+  result = semExpr(c, n, flags)
+  if result.kind == nkEmpty: 
+    # do not produce another redundant error message:
+    raiseRecoverableError()
+  if result.typ == nil:
+    GlobalError(n.info, errExprXHasNoType, 
+                renderTree(result, {renderNoComments}))
+
 proc semSymGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode =
   result = symChoice(c, n, s)