From d353c20c03f11a78ee67a986893d3900a2c77271 Mon Sep 17 00:00:00 2001 From: Miran Date: Fri, 10 May 2019 08:48:12 +0200 Subject: [PATCH] fixes #7569, all credit to @vincentvidal (#11213) (cherry picked from commit e54546bcffd2224ed0c809992b5e47163c3bc5dc) --- compiler/semtypes.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 9aaab4a922..6f41dcc0f2 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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)