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).