summary refs log tree commit diff stats
path: root/compiler/ccgutils.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-08-01 23:40:48 +0200
committerAraq <rumpf_a@web.de>2014-08-01 23:40:48 +0200
commit9673e4f2df941bfeeb3e1fe8e66d89fddea1145b (patch)
treeb7178daacba45beb51b3afb453fa256a0d6285d2 /compiler/ccgutils.nim
parent821fe72ff55866737c5b1d9f356b8d142f8836c3 (diff)
downloadNim-9673e4f2df941bfeeb3e1fe8e66d89fddea1145b.tar.gz
progress on deepCopy
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,