Commit c12c99f
committed
[nonisolated-nonsending] Make the AST not consider nonisolated(nonsending) to be an actor isolation crossing point.
We were effectively working around this previously at the SIL level. This caused
us not to obey the semantics of the actual evolution proposal. As an example of
this, in the following, x should not be considered main actor isolated:
```swift
nonisolated(nonsending) func useValue<T>(_ t: T) async {}
@mainactor func test() async {
let x = NS()
await useValue(x)
print(x)
}
```
we should just consider this to be a merge and since useValue does not have any
MainActor isolated parameters, x should not be main actor isolated and we should
not emit an error here.
I also fixed a separate issue where we were allowing for parameters of
nonisolated(nonsending) functions to be passed to @Concurrent functions. We
cannot allow for this to happen since the nonisolated(nonsending) parameters
/could/ be actor isolated. Of course, we have lost that static information at
this point so we cannot allow for it. Given that we have the actual dynamic
actor isolation information, we could dynamically allow for the parameters to be
passed... but that is something that is speculative and is definitely outside of
the scope of this patch.
rdar://1541392371 parent ce7a3b3 commit c12c99f
File tree
5 files changed
+283
-31
lines changed- lib
- SILOptimizer/Utils
- Sema
- test
- ClangImporter
- Inputs
- Concurrency
5 files changed
+283
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
445 | 460 | | |
446 | 461 | | |
447 | 462 | | |
| |||
534 | 549 | | |
535 | 550 | | |
536 | 551 | | |
537 | | - | |
538 | | - | |
539 | | - | |
| 552 | + | |
| 553 | + | |
540 | 554 | | |
541 | 555 | | |
542 | 556 | | |
| |||
980 | 994 | | |
981 | 995 | | |
982 | 996 | | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
983 | 1004 | | |
984 | 1005 | | |
985 | 1006 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4034 | 4034 | | |
4035 | 4035 | | |
4036 | 4036 | | |
| 4037 | + | |
| 4038 | + | |
| 4039 | + | |
| 4040 | + | |
4037 | 4041 | | |
4038 | 4042 | | |
4039 | 4043 | | |
| |||
4079 | 4083 | | |
4080 | 4084 | | |
4081 | 4085 | | |
4082 | | - | |
4083 | | - | |
4084 | | - | |
4085 | | - | |
4086 | 4086 | | |
4087 | 4087 | | |
4088 | 4088 | | |
| |||
4133 | 4133 | | |
4134 | 4134 | | |
4135 | 4135 | | |
4136 | | - | |
4137 | | - | |
4138 | | - | |
4139 | | - | |
4140 | | - | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
4141 | 4155 | | |
4142 | 4156 | | |
4143 | 4157 | | |
| |||
8005 | 8019 | | |
8006 | 8020 | | |
8007 | 8021 | | |
| 8022 | + | |
| 8023 | + | |
| 8024 | + | |
8008 | 8025 | | |
8009 | | - | |
8010 | | - | |
8011 | | - | |
8012 | | - | |
8013 | | - | |
| 8026 | + | |
| 8027 | + | |
| 8028 | + | |
| 8029 | + | |
8014 | 8030 | | |
8015 | 8031 | | |
8016 | 8032 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
0 commit comments