Files
swift-mirror/test/ClangImporter/objc_init_generics.swift
Doug Gregor 6486e6ca49 [Clang importer] Allow us to wire up overrides with generic classes.
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.
2018-07-03 10:50:24 -07:00

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())
}
}