correctly backport #13667

This commit is contained in:
narimiran
2020-04-21 07:44:53 +02:00
parent 122ac6775a
commit 5cae61ce21

View File

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