-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ClangImporter] Don't transform NSObject<...> when there's no NSObject protocol #27409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
// Skip if there is no NSObject protocol. | ||
auto nsObjectProtoType = | ||
Impl.getNSObjectProtocolType(); | ||
if (nsObjectProtoType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens in the else
case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be treated like the other non NSObject<...> types, except if it hits another special case it is imported as a protocol composition of the class and the protocols.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, so far we've just tested that "we have protocols" and "the class is NSObject". Okay.
6d619d3
to
d6264a7
Compare
@swift-ci Please smoke test |
d6264a7
to
d84e2e8
Compare
@swift-ci Please smoke test |
|
||
// RUN: %target-swift-frontend -typecheck %s -import-objc-header %S/Inputs/no-nsobject-protocol.h | ||
|
||
// REQUIRES: objc_interop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think since there are no external dependencies you can use -enable-objc-interop
instead.
… protocol If there is no NSObject protocol, skip a special case when importing types like `NSObject <NSCopying>` that converts them to `id <NSObject, NSCopying>`. Fix rdar://problem/34597302
d84e2e8
to
cf526b4
Compare
@swift-ci Please smoke test |
If there is no NSObject protocol skip a special case when importing types like
NSObject <NSCopying>
that converts them toid <NSObject, NSCopying>
.Fix rdar://problem/34597302