From 35429f6252fc96bce4d9b35c0c9efb15f501bcd3 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:08:38 +0800 Subject: [PATCH] fixes #25441; fixes #7355; deletes void args from the argument list (#25455) fixes #25441; fixes #7355 --------- Co-authored-by: Andreas Rumpf (cherry picked from commit 81610095e67e52ce21227e407569ffff0ac62fea) --- compiler/semcall.nim | 17 ++++++++++++++++- compiler/semexprs.nim | 5 +---- compiler/sigmatch.nim | 1 + tests/generics/tvoids.nim | 19 +++++++++++++++++++ tests/macros/t16758.nim | 4 ---- 5 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 tests/generics/tvoids.nim diff --git a/compiler/semcall.nim b/compiler/semcall.nim index a80b58be7b..4b645ac256 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -830,6 +830,21 @@ proc inheritBindings(c: PContext, x: var TCandidate, expectedType: PType) = for i in 0 ..< flatUnbound.len(): x.bindings.put(flatUnbound[i], flatBound[i]) +proc compactVoidArgs(n: PNode): PNode = + # deletes void args from the argument list, which are created by `setSon` + var hasNil = false + for i in 0..