summary refs log tree commit diff stats
path: root/compiler/vmdeps.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/vmdeps.nim')
-rw-r--r--compiler/vmdeps.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim
index 1b2538c79..e3d9533aa 100644
--- a/compiler/vmdeps.nim
+++ b/compiler/vmdeps.nim
@@ -242,7 +242,7 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
   of tyRange:
     result = newNodeIT(nkBracketExpr, if t.n.isNil: info else: t.n.info, t)
     result.add atomicType("range", mRange)
-    if inst:
+    if inst and t.n.len == 2:
       let rng = newNodeX(nkInfix)
       rng.add newIdentNode(getIdent(cache, ".."), info)
       rng.add t.n.sons[0].copyTree
@@ -250,7 +250,8 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
       result.add rng
     else:
       result.add t.n.sons[0].copyTree
-      result.add t.n.sons[1].copyTree
+      if t.n.len > 1:
+        result.add t.n.sons[1].copyTree
   of tyPointer: result = atomicType("pointer", mPointer)
   of tyString: result = atomicType("string", mString)
   of tyCString: result = atomicType("cstring", mCstring)