Skip to content

Commit 5344d16

Browse files
committed
[Serialization] Make sure grandchild overrides can be dropped too.
If a base method's not available, we already drop the overridding method. Make sure this works even when the base method is itself an override that failed to load.
1 parent db1fc95 commit 5344d16

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/Serialization/Recovery/overrides.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ public class A_Sub: Base {
7474
public override var disappearingProperty: Int { return 0 }
7575
}
7676

77+
public class A_Sub2: A_Sub {
78+
public override func disappearingMethod() {}
79+
}
80+
81+
7782
// CHECK-LABEL: class A_Sub : Base {
7883
// CHECK-NEXT: func disappearingMethod()
7984
// CHECK-NEXT: func nullabilityChangeMethod() -> Any?
@@ -83,10 +88,19 @@ public class A_Sub: Base {
8388
// CHECK-NEXT: init()
8489
// CHECK-NEXT: {{^}$}}
8590

91+
// CHECK-LABEL: class A_Sub2 : A_Sub {
92+
// CHECK-NEXT: func disappearingMethod()
93+
// CHECK-NEXT: init()
94+
// CHECK-NEXT: {{^}$}}
95+
8696
// CHECK-RECOVERY-LABEL: class A_Sub : Base {
8797
// CHECK-RECOVERY-NEXT: init()
8898
// CHECK-RECOVERY-NEXT: {{^}$}}
8999

100+
// CHECK-RECOVERY-LABEL: class A_Sub2 : A_Sub {
101+
// CHECK-RECOVERY-NEXT: init()
102+
// CHECK-RECOVERY-NEXT: {{^}$}}
103+
90104
extension Base {
91105
@nonobjc func disappearingMethodWithOverload() -> SwiftOnlyClass? { return nil }
92106
}

0 commit comments

Comments
 (0)