This commit is contained in:
ringabout
2026-05-26 19:20:51 +08:00
parent 2d661a8724
commit 2ab30071ec
2 changed files with 3 additions and 4 deletions

View File

@@ -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):

View File

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