Skip to content

Commit 391ef5b

Browse files
committed
---
yaml --- r: 349338 b: refs/heads/master-next c: 996f043 h: refs/heads/master
1 parent 8ef1934 commit 391ef5b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 7b3af6b0d4900038562ee8701c8afc235e14fec4
3+
refs/heads/master-next: 996f0433c6e58c4e276fcc9b2a35e92e1eccd64d
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/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

branches/master-next/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)