Commit eef2704
committed
Reimplement actor isolation checking for referencing a declaration.
Start collapsing the several implementations of actor isolation checking
into a single place that determines what it means to reference a declaration
from a given context, potentially supplying an instance for an actor. This
is partly cleanup, and partly staging for the implementation of the
Sendable restrictions introduced in SE-0338. The result of this check
falls into one of three categories:
* Reference occurs within the same concurrency domain (actor/task)
* Reference leaves an actor context to a nonisolated context (SE-0338)
* Reference enters the context of the actor, which might require a
combination of implicit async, implicit throws, and a "distributed" check.
Throughout this change I've sought to maintain the existing semantics,
even where I believe they are incorrect. The changes to the test cases
are not semantic changes, but reflect the unification of some
diagnostic paths that changed the diagnostic text but not when or how
those diagnostics are produced. Additionally, SE-0338 has not yet been
implemented, although this refactoring makes it easier to implement
SE-0338.
Use this new actor isolation checking scheme to implement the most
common actor-isolation check, which occurs when accessing a member of
an instance.1 parent cf2e90b commit eef2704
File tree
11 files changed
+864
-519
lines changed- include/swift/AST
- lib
- AST
- Sema
- test
- Concurrency
- Distributed
11 files changed
+864
-519
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4541 | 4541 | | |
4542 | 4542 | | |
4543 | 4543 | | |
4544 | | - | |
| 4544 | + | |
4545 | 4545 | | |
4546 | | - | |
| 4546 | + | |
| 4547 | + | |
4547 | 4548 | | |
4548 | 4549 | | |
4549 | | - | |
4550 | | - | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
4551 | 4554 | | |
4552 | 4555 | | |
4553 | 4556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9380 | 9380 | | |
9381 | 9381 | | |
9382 | 9382 | | |
| 9383 | + | |
| 9384 | + | |
| 9385 | + | |
| 9386 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7827 | 7827 | | |
7828 | 7828 | | |
7829 | 7829 | | |
| 7830 | + | |
| 7831 | + | |
| 7832 | + | |
7830 | 7833 | | |
7831 | 7834 | | |
7832 | 7835 | | |
| |||
0 commit comments