fixes #6016 union alias trigger bad codegen (#6117)

* fixes #6016 union alias trigger bad codegen
* cpp test ok
* merging some test into one file
This commit is contained in:
andri lim 2017-08-03 16:03:47 +07:00 • committed by Andreas Rumpf
commit 57edf619fe
6 changed files with 176 additions and 141 deletions

View file

@ -336,6 +336,7 @@ proc getTypePre(m: BModule, typ: PType; sig: SigHash): Rope =
if result == nil: result = cacheGetType(m.typeCache, sig)
proc structOrUnion(t: PType): Rope =
let t = t.skipTypes({tyAlias})
(if tfUnion in t.flags: rope("union") else: rope("struct"))
proc getForwardStructFormat(m: BModule): string =