Fix @objcImpl subclass init visibility computation

When writing an @objc subclass of an @objcImplementation class, implicit initializers in the subclass were treated as overriding the *implementation decl*, not the *interface decl*, of the initializer in the superclass. This caused Swift to incorrectly compute the visibility of the superclass initializer and omit an `override` keyword from the module interface when one would definitely be necessary.

Correct this oversight by looking up the interface decl matching the superclass implementation in `collectNonOveriddenSuperclassInits()`.
This commit is contained in:
Becca Royal-Gordon
2023-03-23 14:17:36 -07:00
parent c0e240322e
commit e8c43bb168
2 changed files with 33 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ open class SwiftSubclass: ImplClass {
print("subclass mainMethod")
}
// CHECK-DAG: @objc dynamic public init()
// CHECK-DAG: @objc override dynamic public init()
// CHECK-DAG: @objc deinit
}
// CHECK: }