Skip to content

[4.2] IRGen: Use swift_getObjectType to get the type(of:) mixed classes. #16924

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

jckarter
Copy link
Contributor

A Swift subclass of an ObjC class can be dynamically subclassed, but type(of:) shouldn't return the artificial subclass, since that's not what -class does for ObjC classes, and people expect Bundle(for: type(of: c)) to work like [NSBundle bundleForClass: [c class]] would in ObjC. Fixes rdar://problem/37319860.

@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 20bc010e5f9925c8ed2c8e237d9b6c5cb61b0dbc

A Swift subclass of an ObjC class can be dynamically subclassed, but `type(of:)` shouldn't return the artificial subclass, since that's not what -class does for ObjC classes, and people expect `Bundle(for: type(of: c))` to work like `[NSBundle bundleForClass: [c class]]` would in ObjC. Fixes rdar://problem/37319860.
@jckarter jckarter force-pushed the type-of-mixed-class-4.2 branch from 20bc010 to 5de4d34 Compare May 31, 2018 20:09
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@swift-ci Please test source compatibility

1 similar comment
@jckarter
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 20bc010e5f9925c8ed2c8e237d9b6c5cb61b0dbc

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 20bc010e5f9925c8ed2c8e237d9b6c5cb61b0dbc

@jckarter jckarter merged commit 4d0f100 into swiftlang:swift-4.2-branch Jun 4, 2018
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.

2 participants