fixes #7569, all credit to @vincentvidal (#11213)

(cherry picked from commit e54546bcff)
This commit is contained in:
Miran
2019-05-10 08:48:12 +02:00
committed by narimiran
parent b85cc17998
commit d353c20c03

View File

@@ -725,8 +725,8 @@ proc addInheritedFieldsAux(c: PContext, check: var IntSet, pos: var int,
of nkOfBranch, nkElse:
addInheritedFieldsAux(c, check, pos, lastSon(n.sons[i]))
else: internalError(c.config, n.info, "addInheritedFieldsAux(record case branch)")
of nkRecList:
for i in countup(0, sonsLen(n) - 1):
of nkRecList, nkRecWhen, nkElifBranch, nkElse:
for i in 0 ..< sonsLen(n):
addInheritedFieldsAux(c, check, pos, n.sons[i])
of nkSym:
incl(check, n.sym.name.id)