-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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 support for identity key paths. #18804
Conversation
@swift-ci Please test |
Build failed |
Build failed |
These builtins don't need ownership tracking because they shouldn't ever appear in SIL. NFC
7e62ffa
to
49b6a09
Compare
@swift-ci Please test |
Build failed |
Build failed |
49b6a09
to
e3c51d6
Compare
@swift-ci Please test |
Build failed |
Build failed |
Make sure the implementation can handle a key path with zero components by removing inappropriate assumptions that the number of components is always non-empty. Identity key paths also need some special behavior: - Appending an identity key path should be an identity operation for the other operand - Identity key paths have a `MemoryLayout.offset(of:)` zero - Identity key paths interop with KVC as key paths to `@"self"` To be able to exercise and test this behavior, add a `Builtin.identityKeyPath()` function and `WritableKeyPath._identity` accessor in lieu of finalized syntax.
e3c51d6
to
44b55ae
Compare
@swift-ci Please test |
Build failed |
Build failed |
Make sure the implementation can handle a key path with zero components by removing inappropriate assumptions that the number of components is always non-empty. Identity key paths also need some special behavior:
MemoryLayout.offset(of:)
zero@"self"
To be able to exercise and test this behavior, add a
Builtin.identityKeyPath()
function andWritableKeyPath._identity
accessor in lieu of finalized syntax.rdar://problem/40538312