Skip to content

Make sure artificial subclasses work with '===' and casting #17765

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
merged 1 commit into from
Jul 5, 2018

Conversation

jrose-apple
Copy link
Contributor

Dynamic subclasses aren't really valid Swift type metadata, but they can still be used as values of type AnyClass. Make sure we don't assert when that happens.

No intended functionality change.

@jrose-apple jrose-apple requested review from jckarter and mikeash July 5, 2018 18:59
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

Dynamic subclasses aren't /really/ valid Swift type metadata, but
they can still be used as values of type AnyClass. Make sure we
don't assert when that happens.

No intended functionality change.
@jrose-apple jrose-apple force-pushed the artificial-limitation branch from cb02014 to d3e8c98 Compare July 5, 2018 19:00
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - cb0201429e1592cf4f7a7ab3992b900579fb6cb5

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - cb0201429e1592cf4f7a7ab3992b900579fb6cb5

Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. As we discussed offline, we could most likely make a reasonable effort to holistically support artificial subclasses as proper type metadata, but this is a good targeted fix for a particular legitimate use pattern that's broken now.

@jrose-apple jrose-apple merged commit 2345a54 into swiftlang:master Jul 5, 2018
@jrose-apple jrose-apple deleted the artificial-limitation branch July 5, 2018 22:54
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Jul 13, 2018
…g#17765)

Dynamic subclasses aren't /really/ valid Swift type metadata, but
they can still be used as values of type AnyClass. Make sure we
don't assert when that happens.

No intended functionality change.

(cherry picked from commit 2345a54)
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