diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index c39fb47e1b..f4a9661690 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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)