-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SILGen: Emit property descriptors for conditionally Copyable and Escapable types. #81617
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
SILGen: Emit property descriptors for conditionally Copyable and Escapable types. #81617
Conversation
@swift-ci Please test |
177d989
to
2ae0954
Compare
@swift-ci Please 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.
Thanks
2ae0954
to
3aedcc0
Compare
@swift-ci Please test |
@swift-ci Please test Linux |
|
||
// If the type is an archetype, then it just needs Copyable and Escapable | ||
// constraints imposed. | ||
if (ty->is<ArchetypeType>()) { |
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.
lookupConformance() returns an abstract conformance if you give it an archetype or a type parameter. Is this conditional necessary?
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.
lookupConformance
seems to actually check the conformances of ArchetypeType
s, which I don't want here. The doc comment for lookupConformance
does say it doesn't check conditional conformances, so it seems like it would be morally appropriate for it to unconditionally return an abstract conformance given an archetype, but (at least for 6.2) I didn't want to track down all the reliances on the existing behavior.
…pable types. Key paths can't reference non-escapable or non-copyable storage declarations, so we don't need to refer to them resiliently, and can elide their property descriptors. However, declarations may still be conditionally Copyable and Escapable, and if so, then they still need a property descriptor for resilient key path references. When a property or subscript can be used in a context where it is fully Copyable and Escapable, emit the property descriptor in a generic environment constrained by the necessary conditional constraints. Fixes rdar://151628396.
3aedcc0
to
22eb7e6
Compare
@swift-ci Please test |
Key paths can't reference non-escapable or non-copyable storage declarations,
so we don't need to refer to them resiliently, and can elide their property
descriptors.
However, declarations may still be conditionally Copyable and Escapable, and
if so, then they still need a property descriptor for resilient key path
references. When a property or subscript can be used in a context where it
is fully Copyable and Escapable, emit the property descriptor in a generic
environment constrained by the necessary conditional constraints.
Fixes rdar://151628396.