summary refs log tree commit diff stats
path: root/compiler/ccgutils.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/ccgutils.nim')
-rw-r--r--compiler/ccgutils.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim
index 04983d6a4..6af6a857c 100644
--- a/compiler/ccgutils.nim
+++ b/compiler/ccgutils.nim
@@ -89,8 +89,10 @@ proc getUniqueType*(key: PType): PType =
   of tyTypeDesc, tyTypeClasses, tyGenericParam,
      tyFromExpr, tyFieldAccessor:
     internalError("GetUniqueType")
-  of tyGenericInst, tyDistinct, tyOrdinal, tyMutable,
-     tyConst, tyIter, tyStatic:
+  of tyDistinct:
+    if key.deepCopy != nil: result = key
+    else: result = getUniqueType(lastSon(key))
+  of tyGenericInst, tyOrdinal, tyMutable, tyConst, tyIter, tyStatic:
     result = getUniqueType(lastSon(key))
   of tyArrayConstr, tyGenericInvokation, tyGenericBody,
      tyOpenArray, tyArray, tySet, tyRange, tyTuple,