Skip to content

Conversation

@nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Oct 20, 2025

Based on #84472 .

Before the feature is enabled, a var decl for which a reading accessor is implemented via _read still had as its opaque accessor a getter (unless it's marked @_borrowed, it's noncopyable, or it has a lifetime dependency). So when that _read is replaced with a read/yielding borrow, it is still necessary to emit a getter. And for back deployment it is still necessary to provide a default override of the getter in terms of the read.

rdar://149352519

Lift this function and enum out of the body of
OpaqueReadOwnershipRequest::evaluate .
Prefix it "direct" to indicate that it doesn't consider supertypes.
When storage overrides a supertype's storage, the storage's opaque
access must be via the same mechanism as the supertype.

rdar://156627653
In preparation for making the implementation more than a one-liner.
Before the feature is enabled, a var decl for which a reading accessor
is implemented via _read still had as its opaque accessor a getter
(unless it's marked @_borrowed, it's noncopyable, or it has a lifetime
dependency).  So when that `_read` is replaced with a `read`/`yielding
borrow`, it is still necessary to emit a getter.  And for back
deployment it is still necessary to provide a default override of the
getter in terms of the `read`.

rdar://149352519
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

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.

1 participant