From 065f46afa81f8220697f30b0deeb5ea2beccf4be Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 6 May 2026 21:33:46 +0800 Subject: [PATCH] fixes #23765; Method calling proc with return value overlapping declared generic type generates invalid C --- compiler/seminst.nim | 3 ++- compiler/semtypinst.nim | 3 ++- tests/ccgbugs2/tcodegen.nim | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index a34467636a..7d0585d444 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -81,7 +81,8 @@ proc sameInstantiation(a, b: TInstantiation): bool = if not compareTypes(a.concreteTypes[i], b.concreteTypes[i], flags = {ExactTypeDescValues, ExactGcSafety, - PickyCAliases}): return + PickyCAliases, + PickyBackendAliases}): return result = true else: result = false diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim index 5f846c80ac..326fbd63f7 100644 --- a/compiler/semtypinst.nim +++ b/compiler/semtypinst.nim @@ -52,7 +52,8 @@ proc searchInstTypes*(g: ModuleGraph; key: PType): PType = for j in FirstGenericParamAt..