This commit is contained in:
Araq 2013-05-04 13:21:36 +02:00
commit af441e607f
4 changed files with 35 additions and 7 deletions

View file

@ -72,6 +72,10 @@ proc commonType*(x, y: PType): PType =
elif b.kind in {tyExpr, tyNil}: result = x
elif a.kind == tyStmt: result = a
elif b.kind == tyStmt: result = b
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)
elif b.kind in {tyArray, tyArrayConstr, tySet, tySequence} and
a.kind == b.kind:
# check for seq[empty] vs. seq[int]