mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use ClassDecl::ForeignKind to model Clang's objc_runtime_visible.
We're now correctly checking for inheritance, adding @objc methods, and adding @objc protocols for both CF types and objc_runtime_visible classes (those without visible symbols). The latter is used for some of the types in Dispatch, which has exposed some of the classes that were considered implementation details on past OSs. We still don't properly implement using 'as?' to check conformance to a Swift protocol for a CF or objc_runtime_visible type, but we can do that later. rdar://problem/26850367
This commit is contained in:
@@ -5660,8 +5660,7 @@ namespace {
|
||||
nsObjectTy->getClassOrBoundGenericClass();
|
||||
|
||||
auto result = createRootClass(nsObjectDecl->getDeclContext());
|
||||
// FIXME: Should use RuntimeOnly.
|
||||
result->setForeignClassKind(ClassDecl::ForeignKind::CFType);
|
||||
result->setForeignClassKind(ClassDecl::ForeignKind::RuntimeOnly);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5732,6 +5731,8 @@ namespace {
|
||||
|
||||
if (declaredNative)
|
||||
markMissingSwiftDecl(result);
|
||||
if (decl->getAttr<clang::ObjCRuntimeVisibleAttr>())
|
||||
result->setForeignClassKind(ClassDecl::ForeignKind::RuntimeOnly);
|
||||
|
||||
// If this Objective-C class has a supertype, import it.
|
||||
SmallVector<TypeLoc, 4> inheritedTypes;
|
||||
|
||||
Reference in New Issue
Block a user