mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A use of "getAs<ClassType>()" when trying to wire up the overrides of an imported Objective-C initializer meant that imported Objective-C generic classes didn't get their overrides set properly. This could lead to redundant initializers; use a proper accessor, since we only need the ClassDecl anyway. Fixes SR-8142 / rdar://problem/41591677.
18 lines
532 B
Swift
18 lines
532 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S/Inputs/custom-modules -import-objc-header %S/Inputs/objc_init_generics.h %s -verify
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
// expected-no-diagnostics
|
|
|
|
import Foundation
|
|
|
|
class MyConcreteClass: MyGenericClass<NSObject> {
|
|
// Make sure we don't complain about this "override", because MyGenericClass
|
|
// was getting an init() that was distinct from its superclass's init() due
|
|
// to a bug in the Clang importer.
|
|
init() {
|
|
super.init(value: NSObject())
|
|
}
|
|
}
|
|
|