From 2ab30071ec7a1a1af2efaca2bdd1968dc04a5309 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Tue, 26 May 2026 19:20:51 +0800 Subject: [PATCH] progress --- compiler/sigmatch.nim | 4 +--- compiler/types.nim | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 2e9c9fe108..db06d3e427 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -794,9 +794,7 @@ proc procParamTypeRel(c: var TCandidate; f, a: PType): TTypeRelation = # Note that `result` is equal; now check whether they have the same # backend type. if fCheck != nil and aCheck != nil and - not sameBackendTypePickyAliases( - fCheck.skipTypes({tyVar, tyLent, tySink, tyOwned}), - aCheck.skipTypes({tyVar, tyLent, tySink, tyOwned})): + not sameBackendTypePickyAliases(fCheck, aCheck, {IgnoreFlags}): result = isNone if result <= isSubrange or inconsistentVarTypes(f, a): diff --git a/compiler/types.nim b/compiler/types.nim index de24471e7d..f4c7e74bc5 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1069,9 +1069,10 @@ proc sameBackendTypeIgnoreRange*(x, y: PType): bool = c.cmp = dcEqIgnoreDistinct result = sameTypeAux(x, y, c) -proc sameBackendTypePickyAliases*(x, y: PType): bool = +proc sameBackendTypePickyAliases*(x, y: PType, flags: TTypeCmpFlags = {}): bool = var c = initSameTypeClosure() c.flags.incl {IgnoreTupleFields, IgnoreRangeShallow, PickyCAliases, PickyBackendAliases} + c.flags.incl flags c.cmp = dcEqIgnoreDistinct result = sameTypeAux(x, y, c)