This commit is contained in:
Andreas Rumpf 2016-05-18 12:39:49 +02:00
commit 2ac3e12372
3 changed files with 9 additions and 6 deletions

View file

@ -781,9 +781,9 @@ proc typeSectionFinalPass(c: PContext, n: PNode) =
var x = a[2]
while x.kind in {nkStmtList, nkStmtListExpr} and x.len > 0:
x = x.lastSon
if x.kind notin {nkObjectTy, nkDistinctTy, nkEnumTy, nkEmpty}:
if x.kind notin {nkObjectTy, nkDistinctTy, nkEnumTy, nkEmpty} and
s.typ.kind notin {tyObject, tyEnum, tyDistinct}:
# type aliases are hard:
#MessageOut('for type ' + typeToString(s.typ));
var t = semTypeNode(c, x, nil)
assert t != nil
if t.kind in {tyObject, tyEnum, tyDistinct}: