summary refs log tree commit diff stats
path: root/compiler/semdata.nim
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2019-01-18 07:51:22 +0000
committerAndreas Rumpf <rumpf_a@web.de>2019-01-18 08:51:22 +0100
commit1e63f1edb3fa594bcdce39eb5195d5f5d2644e67 (patch)
tree04b8bf5530b2b8960ed890d3f34a1aead417453b /compiler/semdata.nim
parent214f48eae9b6a02d5ba68ddf0b1e6b9a26bddacb (diff)
downloadNim-1e63f1edb3fa594bcdce39eb5195d5f5d2644e67.tar.gz
destructors: first step towards fixing #9617 (#10341)
Diffstat (limited to 'compiler/semdata.nim')
-rw-r--r--compiler/semdata.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 735c6f6b1..a05bda32d 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -286,6 +286,13 @@ proc makeVarType*(c: PContext, baseType: PType; kind = tyVar): PType =
     result = newTypeS(kind, c)
     addSonSkipIntLit(result, baseType)
 
+proc makeVarType*(owner: PSym, baseType: PType; kind = tyVar): PType =
+  if baseType.kind == kind:
+    result = baseType
+  else:
+    result = newType(kind, owner)
+    addSonSkipIntLit(result, baseType)
+
 proc makeTypeDesc*(c: PContext, typ: PType): PType =
   if typ.kind == tyTypeDesc:
     result = typ