summary refs log tree commit diff stats
path: root/compiler/semmagic.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semmagic.nim')
-rw-r--r--compiler/semmagic.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index c3c032147..1e579a959 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -49,7 +49,9 @@ proc semTypeOf(c: PContext; n: PNode): PNode =
     else:
       m = mode.intVal
   result = newNodeI(nkTypeOfExpr, n.info)
+  inc c.inTypeofContext
   let typExpr = semExprWithType(c, n[1], if m == 1: {efInTypeof} else: {})
+  dec c.inTypeofContext
   result.add typExpr
   result.typ = makeTypeDesc(c, typExpr.typ)