make case-object transitions explicit, make unknownLineInfo a const, replace a few magic numbers with consts (#13170)

This commit is contained in:
Jasper Jenkins 2020-01-17 01:34:32 -08:00 • committed by Andreas Rumpf
commit 796aafe7e0
35 changed files with 182 additions and 203 deletions

View file

@ -366,11 +366,11 @@ proc computeSizeAlign(conf: ConfigRef; typ: PType) =
OffsetAccum(maxAlign: 1)
if tfUnion in typ.flags:
if tfPacked in typ.flags:
let info = if typ.sym != nil: typ.sym.info else: unknownLineInfo()
let info = if typ.sym != nil: typ.sym.info else: unknownLineInfo
localError(conf, info, "union type may not be packed.")
accum = OffsetAccum(offset: szUnknownSize, maxAlign: szUnknownSize)
elif accum.offset != 0:
let info = if typ.sym != nil: typ.sym.info else: unknownLineInfo()
let info = if typ.sym != nil: typ.sym.info else: unknownLineInfo
localError(conf, info, "union type may not have an object header")
accum = OffsetAccum(offset: szUnknownSize, maxAlign: szUnknownSize)
else: