Skip to content

Commit 90410a0

Browse files
committed
Update patch to account for earlier codebase
Update the patch to account for a couple of master changes that aren't in 4.2: - `getAsNominalTypeOrNominalTypeExtensionContext` was renamed to `getSelfNominalTypeDecl` - Superclass constrained protocols aren't implemented
1 parent fc5cb09 commit 90410a0

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

lib/Sema/CSRanking.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,8 +1002,8 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
10021002
choice1.getKind() != OverloadChoiceKind::DeclViaDynamic &&
10031003
choice2.getKind() != OverloadChoiceKind::DeclViaDynamic &&
10041004
isa<VarDecl>(decl1) && isa<VarDecl>(decl2)) {
1005-
auto *nominal1 = dc1->getSelfNominalTypeDecl();
1006-
auto *nominal2 = dc2->getSelfNominalTypeDecl();
1005+
auto *nominal1 = dc1->getAsNominalTypeOrNominalTypeExtensionContext();
1006+
auto *nominal2 = dc2->getAsNominalTypeOrNominalTypeExtensionContext();
10071007
if (nominal1 && nominal2 && nominal1 != nominal2) {
10081008
isVarAndNotProtocol1 = !isa<ProtocolDecl>(nominal1);
10091009
isVarAndNotProtocol2 = !isa<ProtocolDecl>(nominal2);

test/Constraints/sr7425.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ extension Y {
1212
var bar: Int { return foo }
1313
}
1414

15-
protocol Z : Y {
16-
var foo: Int { get }
17-
var bar: Int { get }
18-
}
19-
2015
class GenericClass<T> {
2116
var foo: T
2217
init(_ foo: T) { self.foo = foo }
@@ -37,16 +32,6 @@ func testExistentialPropertyProtocolClass(_ t: X & Y) {
3732
_ = t.bar
3833
}
3934

40-
func testGenericPropertySubclassConstrainedProtocol<T : Z>(_ t: T) {
41-
_ = t.foo
42-
_ = t.bar
43-
}
44-
45-
func testExistentialPropertySubclassConstrainedProtocol(_ t: Z) {
46-
_ = t.foo
47-
_ = t.bar
48-
}
49-
5035
func testExistentialPropertyProtocolGenericClass(_ t: GenericClass<Int> & X) {
5136
_ = t.foo
5237
_ = t.bar

0 commit comments

Comments
 (0)