From 8ccba2dc866c13b3c7f69d0a933ae405b5395cd7 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:47:14 +0800 Subject: [PATCH] fixes #25509; removes void fields from a named tuple type (#25515) fixes #25509 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> (cherry picked from commit b51be756136049ad0e401db64fcd9f470ab336ff) --- compiler/semtypinst.nim | 24 +++++++++++++++++- tests/tuples/ttuples_issues.nim | 44 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 303d801c2b..b3e3d9ed14 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -562,6 +562,26 @@ proc eraseVoidParams*(t: PType) = setLen t.n.sons, pos break +proc eraseTupleVoidFields*(t: PType) = + ## Remove void fields from a named tuple type, compacting both `t.n` + ## (the field symbol nodes) and `t.sonsImpl` (the child types). + if t.n == nil: return # anonymous tuple, nothing to compact + for i in 0..