destructors: first step towards fixing #9617 (#10341)

This commit is contained in:
cooldome 2019-01-18 07:51:22 +00:00 • committed by Andreas Rumpf
commit 1e63f1edb3
6 changed files with 110 additions and 67 deletions

View file

@ -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