From fe4f4a24efe37e1dc1e1ca6e81d74657025bb5b9 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 10 Apr 2026 14:47:25 +0800 Subject: [PATCH] adds procParamTypeBackendAliases to opt out c type aliases --- compiler/options.nim | 3 +++ compiler/sigmatch.nim | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/options.nim b/compiler/options.nim index fc15ee9792..bd57cbc5a6 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -259,6 +259,9 @@ type ## Old transformation for closures in JS backend noPanicOnExcept ## don't panic on bare except + procParamTypeBackendAliases + ## Keep the old proc type compatibility rules that ignore backend + ## c type aliases. SymbolFilesOption* = enum disabledSf, writeOnlySf, readOnlySf, v2Sf, stressTest diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 538ad974eb..b3d1296115 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -784,7 +784,8 @@ proc procParamTypeRel(c: var TCandidate; f, a: PType): TTypeRelation = # if f is metatype. result = typeRel(c, f, a) - if result == isEqual: + if result == isEqual and + procParamTypeBackendAliases notin c.c.config.legacyFeatures: # Ensure types that are semantically equal also match at the backend level. # E.g. reject assigning proc(csize_t) to proc(uint) since these map to # different C types (size_t vs unsigned long long).