Commit Graph

4 Commits

Author SHA1 Message Date
Nate Chandler
d5e000fe22 [Sema] Fix inconsistent mutatingness diagnostic.
Refer to the correct problematic accessor or accessors.
2024-09-26 18:10:38 -07:00
David Zarzycki
f99124569b [Diag] Formalize SelfAccessKind printing 2019-03-25 15:40:26 -04:00
John McCall
f6d933b032 When picking a binding disjunction, try to simplify to a common TV. 2018-08-16 18:27:29 -04:00
John McCall
7a4aeed570 Implement generalized accessors using yield-once coroutines.
For now, the accessors have been underscored as `_read` and `_modify`.
I'll prepare an evolution proposal for this feature which should allow
us to remove the underscores or, y'know, rename them to `purple` and
`lettuce`.

`_read` accessors do not make any effort yet to avoid copying the
value being yielded.  I'll work on it in follow-up patches.

Opaque accesses to properties and subscripts defined with `_modify`
accessors will use an inefficient `materializeForSet` pattern that
materializes the value to a temporary instead of accessing it in-place.
That will be fixed by migrating to `modify` over `materializeForSet`,
which is next up after the `read` optimizations.

SIL ownership verification doesn't pass yet for the test cases here
because of a general fault in SILGen where borrows can outlive their
borrowed value due to being cleaned up on the general cleanup stack
when the borrowed value is cleaned up on the formal-access stack.
Michael, Andy, and I discussed various ways to fix this, but it seems
clear to me that it's not in any way specific to coroutine accesses.

rdar://35399664
2018-07-23 18:59:58 -04:00