-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Tiny bit more progress on IRGen support for subclass existentials #8788
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
Tiny bit more progress on IRGen support for subclass existentials #8788
Conversation
|
@swift-ci Please smoke test |
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.
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.
Good catch. It would need to be more conservative.
lib/IRGen/GenArchetype.cpp
Outdated
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.
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.
Yeah, that would work and be a bit more optimal. If we don't already, we should also check the @_unsafe_no_tagged_pointer attribute and whether ObjC interop is enabled at all.
7831185 to
f30ee81
Compare
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.
This assertion isn't valid; this code runs even when type-checking fails.
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.
Do you have a test case in mind I can try? I'll address this in an upcoming patch along with the other stuff above about spare bits.
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.
I think even just the obvious thing would crash:
// compile with -emit-reference-dependencies and check the resulting swiftdeps file
class MyClass {}
extension Int: (MyClass & Equatable) {}
Tested by an upcoming patch that adds IRGen SIL tests.
f30ee81 to
03373a1
Compare
|
@swift-ci Please smoke test |
The next step after #8770. Make sure we use the right reference counting style for subclass existentials and class-constrained archetypes. Also, finally remove the
getExistentialTypeProtocols()utility method.