tyTypeDesc and tyRange always have 1 child; this might be tyNone but it is required for skipTypes

This commit is contained in:
Araq 2014-02-05 23:43:13 +01:00
commit d912d18379
11 changed files with 87 additions and 42 deletions

View file

@ -83,7 +83,9 @@ proc commonType*(x, y: PType): PType =
elif a.kind == tyTypeDesc:
# turn any concrete typedesc into the abstract typedesc type
if a.sons == nil: result = a
else: result = newType(tyTypeDesc, a.owner)
else:
result = newType(tyTypeDesc, a.owner)
rawAddSon(result, newType(tyNone, a.owner))
elif b.kind in {tyArray, tyArrayConstr, tySet, tySequence} and
a.kind == b.kind:
# check for seq[empty] vs. seq[int]