Skip to content

Commit 996f043

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 7b3af6b + 3cd2c5f commit 996f043

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/AST/Type.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2366,7 +2366,8 @@ static bool matches(CanType t1, CanType t2, TypeMatchOptions matchMode,
23662366
if (matchMode.contains(TypeMatchFlags::AllowCompatibleOpaqueTypeArchetypes))
23672367
if (auto opaque1 = t1->getAs<OpaqueTypeArchetypeType>())
23682368
if (auto opaque2 = t2->getAs<OpaqueTypeArchetypeType>())
2369-
return opaque1->getBoundSignature() == opaque2->getBoundSignature() &&
2369+
return opaque1->getBoundSignature()->getCanonicalSignature() ==
2370+
opaque2->getBoundSignature()->getCanonicalSignature() &&
23702371
opaque1->getInterfaceType()->getCanonicalType()->matches(
23712372
opaque2->getInterfaceType()->getCanonicalType(), matchMode);
23722373

test/type/opaque.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,3 +459,16 @@ func invoke_52528543<T: P_52528543, U: P_52528543>(x: T, y: U) {
459459
var xab = f_52528543(x: x2)
460460
xab = f_52528543(x: y2) // expected-error{{cannot assign}}
461461
}
462+
463+
protocol Proto {}
464+
465+
struct I : Proto {}
466+
467+
dynamic func foo<S>(_ s: S) -> some Proto {
468+
return I()
469+
}
470+
471+
@_dynamicReplacement(for: foo)
472+
func foo_repl<S>(_ s: S) -> some Proto {
473+
return I()
474+
}

0 commit comments

Comments
 (0)