Update compiler/semtypinst.nim

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ringabout
2026-02-13 19:55:23 +08:00
committed by GitHub
parent 6a424eaf1b
commit 0d83952a4f

View File

@@ -572,7 +572,7 @@ proc eraseTupleVoidFields*(t: PType) =
# found first void field, compact from here
var pos = i
for j in i+1..<t.kidsLen:
if t[j].kind != tyVoid and (j >= t.n.len or t.n[j].kind != nkRecList):
if t[j].kind != tyVoid and j < t.n.len and t.n[j].kind != nkRecList:
t.n[pos] = t.n[j]
t[pos] = t[j]
if t.n[pos].kind == nkSym: