Skip to content

[ClangImporter] Fall back to Swift class names when resolving @class #27921

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

Merged

Conversation

jrose-apple
Copy link
Contributor

@ChristopherRogers' (good) work in #27682 caught places where the Swift compiler was allowing a @class to resolve to a Swift class even if that class had a conflicting Objective-C name, or wasn't intended to be exposed to Objective-C at all. Unfortunately, this broke source compatibility in projects where people were relying on this. Restore that functionality, but only as a fallback; matching the Objective-C name is better than matching the Swift name.

rdar://problem/56681046

Christopher Rogers' (good) work in 49fd5ac caught places where
the Swift compiler was allowing a @Class to resolve to a Swift class
even if that class had a conflicting Objective-C name, or wasn't
intended to be exposed to Objective-C at all. Unfortunately, this
broke source compatibility in projects where people were relying on
this. Restore that functionality, but only as a fallback; matching the
Objective-C name is better than matching the Swift name.

rdar://problem/56681046
@jrose-apple
Copy link
Contributor Author

@ChristopherRogers, I'd appreciate your review as well!

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7ea8546

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@ChristopherRogers
Copy link
Contributor

LGTM! It'd be nice if eventually the compiler could diagnose this so code could be fixed.

@jrose-apple
Copy link
Contributor Author

In the "this class isn't exposed to Objective-C at all" I'm not even sure there's something to fix it to. The other case, definitely—it just needs to wait a version or two so that everyone can switch to the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants