-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[4.0] [ClangImporter] Add direct access for import-as-member types. #11013
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
[4.0] [ClangImporter] Add direct access for import-as-member types. #11013
Conversation
And consolidate two slightly different subclasses of PrettyStackTrace that mostly did the same thing. (cherry picked from commit 7e043cf)
…for-Clang [ClangImporter] Add direct access for import-as-member types.
Linux (rather, gold) is stricter than macOS (ld64) about this, so until we can eliminate the rest of the dependencies this is the best workaround we have. (cherry picked from commit 9e2577d)
I thought of a case I hadn't tested yet, #11018. Holding off on tests and such until I can get that in. |
…swiftlang#11018) Fix-up for 03e1e3b, which fixes the crash caused by the new test case. More https://bugs.swift.org/browse/SR-5284
@swift-ci Please test |
@swift-ci Please test source compatibility |
Build failed |
Build failed |
@swift-ci Please test source compatibility |
Right, this needs a bit of backporting. My bad. |
@swift-ci Please test |
@swift-ci Please test source compatibility |
Build failed |
Build failed |
@swift-ci Please test source compatibility |
A
that has a method that mentions Objective-C typeA.B
(using the "import-as-member" feature), performing the lookup to findA.B
can lead to a circular dependency between deserialization and the importer, which resulted in a compiler crash. This is not a new problem, but it's more important with the release of Swift 4, where a number of Apple SDK types are now newly imported as member types. (The one in the original bug was NSView.AutoresizingMask, formerly NSAutoresizingMaskOptions.) This change adds a "fast path" for direct lookup of a single, unambiguous type nested in an Objective-C type.