-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Override ObjC's class_getImageName to handle Swift classes #17910
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
Override ObjC's class_getImageName to handle Swift classes #17910
Conversation
@swift-ci Please test |
@swift-ci Please test source compatibility |
Build failed |
…That's what I get for adding the arclite change last minute. I'll fix that test in a bit. |
|
||
// Note: The following typealias uses AnyObject instead of AnyClass so that | ||
// the function type is trivially bridgeable to Objective-C. (The | ||
// representation of AnyClass is not the same as Objective-C's 'Class' type.) |
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.
Oops, and this comment is supposed to be up with the typealias, which I moved.
5814d40
to
06e7583
Compare
Test changes only, source compat suite already passed. @swift-ci Please test |
Build failed |
06e7583
to
2985cca
Compare
@swift-ci Please test |
Build failed |
Build failed |
This not only restores the correct behavior for classes with generic ancestry, but also handles actual generic classes as well. (This is the function that backs Foundation's Bundle.init(for: AnyClass) initializer.) https://bugs.swift.org/browse/SR-1917 rdar://problem/33450609&40367300
For the upcoming hook in the ObjC runtime for class_getImageName (see previous commit).
2985cca
to
df974b2
Compare
@swift-ci Please test |
Build failed |
Build failed |
…mageName Override ObjC's class_getImageName to handle Swift classes https://bugs.swift.org/browse/SR-1917 (cherry picked from commit db4ceae)
This not only restores the correct behavior for classes with generic ancestry, but also handles actual generic classes as well. (This is the function that backs Foundation's
Bundle.init(for: AnyClass)
initializer.)Note that this won't actually do anything yet; the ObjC runtime pieces have to be present first, and they aren't. I've run this by @gparker42 already, though, as well as tested it with a custom build of libobjc, and things seem to work.
SR-1917
rdar://problem/33450609&40367300