fixes a bug encountered when running 'nim check posix_haiku.nim'

This commit is contained in:
Araq 2020-05-01 10:28:54 +02:00 • committed by Andreas Rumpf
commit 15f54728ef

View file

@ -723,7 +723,7 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int,
checkSonsLen(it, 2, c.config)
if c.inGenericContext == 0:
var e = semConstBoolExpr(c, it[0])
if e.kind != nkIntLit: internalError(c.config, e.info, "semRecordNodeAux")
if e.kind != nkIntLit: discard "don't report followup error"
elif e.intVal != 0 and branch == nil: branch = it[1]
else:
it[0] = forceBool(c, semExprWithType(c, it[0]))