fixed a serious code generation bug leading to wrong RTTI

This commit is contained in:
Araq 2012-10-19 01:59:28 +02:00
commit 3f82352c2e
7 changed files with 76 additions and 29 deletions

View file

@ -856,7 +856,10 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
result = s.typ
else:
assignType(prev, s.typ)
prev.id = s.typ.id
# bugfix: keep the fresh id for aliases to integral types:
if s.typ.kind notin {tyBool, tyChar, tyInt..tyInt64, tyFloat..tyFloat128,
tyUInt..tyUInt64}:
prev.id = s.typ.id
result = prev
of nkSym:
if n.sym.kind == skType and n.sym.typ != nil: