mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AnyObject is a BridgeableObjectType even if it's not @objc.
Swift SVN r27412
This commit is contained in:
@@ -223,10 +223,14 @@ bool CanType::isObjCExistentialTypeImpl(CanType type) {
|
|||||||
if (protocols.empty())
|
if (protocols.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Any non-@objc protocol makes this no longer ObjC-compatible.
|
// Any non-AnyObject, non-@objc protocol makes this no longer ObjC-compatible.
|
||||||
for (auto proto : protocols) {
|
for (auto proto : protocols) {
|
||||||
if (!proto->isObjC())
|
if (proto->isSpecificProtocol(KnownProtocolKind::AnyObject))
|
||||||
return false;
|
continue;
|
||||||
|
if (proto->isObjC())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1238,8 +1238,7 @@ static Type representsNonTrivialGenericParameter(TypeVariableType *typeVar) {
|
|||||||
for (auto proto : archetype->getConformsTo()) {
|
for (auto proto : archetype->getConformsTo()) {
|
||||||
// AnyObject is always trivially representable as a generic parameter;
|
// AnyObject is always trivially representable as a generic parameter;
|
||||||
// there is no runtime witness.
|
// there is no runtime witness.
|
||||||
auto known = proto->getKnownProtocolKind();
|
if (proto->isSpecificProtocol(KnownProtocolKind::AnyObject))
|
||||||
if (known && *known == KnownProtocolKind::AnyObject)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ObjC protocols are trivially representable as a generic parameter;
|
// ObjC protocols are trivially representable as a generic parameter;
|
||||||
|
|||||||
Reference in New Issue
Block a user