summary refs log tree commit diff stats
path: root/compiler/semdata.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-02-08 17:18:17 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-08 17:18:17 +0100
commit0841c64a3217594d0d260a0f24616b469447c1b9 (patch)
treed16995b64b4cd42b7e3d9adf94dd7f7ff57b600c /compiler/semdata.nim
parentcb9110c43d4ae9c29a0a1e0d54f7735712d4ba62 (diff)
parent444f2231c9b48c34f9bec2ce6cfa3de5ae2560b1 (diff)
downloadNim-0841c64a3217594d0d260a0f24616b469447c1b9.tar.gz
Merge branch 'devel' into araq-quirky-exceptions
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