-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtime] SE-0143: Evaluate conditional conformances at runtime. #14368
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
[Runtime] SE-0143: Evaluate conditional conformances at runtime. #14368
Conversation
@swift-ci please test |
Build failed |
@swift-ci please smoke test and merge |
1 similar comment
@swift-ci please smoke test and merge |
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.
TwoWordPair is going away in #14373. This should wait until that merges.
Bah, it's going to conflict with #14373 even once I've reverted the first commit. I'll rebase once that goes in. |
997ca4b
to
1e2ddc3
Compare
@swift-ci please smoke test and merge |
…ances. Extend protocol conformance descriptors with two more bits of information: * For retroactive conformances, add the module in which the conformance occurs. This will eventually be used for error reporting/ambiguity resolution when retroactive conformances collide. * For conditional conformances, add the conditional requirements. We need these for runtime evaluation of conditional conformances.
When evaluating whether a given type conforms to a protocol, evaluate the conditional requirements and pass the results to the witness table accessor function. This provides the ability to query conditional conformances at runtime, and is the last major part of implementing SE-0143. The newly-added unlock/lock dance in the conformance lookup code is a temporary stub. We have some ideas to do this better. Fixes rdar://problem/34944655.
1e2ddc3
to
81f1574
Compare
@swift-ci please smoke test and merge |
1 similar comment
@swift-ci please smoke test and merge |
|
||
Runtime query of conditional conformances is now implemented. Therefore, | ||
a dynamic cast such as `value as? P`, where the dynamic type of `value` | ||
conditional conforms to `P`, will succeed when the conditional |
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.
*conditionally conforms
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, thanks. I'll fix that in a follow-up commit.
Will this |
No. |
@pitiphong-p : No, this will not go into Swift 4.1. It's dependent on a large number of changes in the Swift compiler and runtime that would not be safe to back port to Swift 4.1. |
I see. Thank you. |
When evaluating whether a given type conforms to a protocol, evaluate the
conditional requirements and pass the results to the witness table
accessor function. This provides the ability to query conditional
conformances at runtime, and is the last major part of implementing
SE-0143.
The newly-added unlock/lock dance in the conformance lookup code is a
temporary stub. We have some ideas to do this better.
Fixes rdar://problem/34944655.