File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
test/Concurrency/toplevel Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1076,6 +1076,10 @@ class ApplyClassifier {
1076
1076
// / global or static 'let' variables, which was previously accepted in
1077
1077
// / compiler versions before 5.10, or for declarations marked preconcurrency.
1078
1078
bool downgradeAsyncAccessToWarning (Decl *decl) {
1079
+ if (decl->preconcurrency ()) {
1080
+ return true ;
1081
+ }
1082
+
1079
1083
if (auto *var = dyn_cast<VarDecl>(decl)) {
1080
1084
ActorReferenceResult::Options options = llvm::None;
1081
1085
// The newly-diagnosed cases are invalid regardless of the module context
@@ -1086,7 +1090,7 @@ class ApplyClassifier {
1086
1090
}
1087
1091
}
1088
1092
1089
- return decl-> preconcurrency () ;
1093
+ return false ;
1090
1094
}
1091
1095
1092
1096
Classification classifyLookup (LookupExpr *E) {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ func nonIsolatedAsync() async {
23
23
await print ( a)
24
24
a = a + 10
25
25
// expected-error@-1:5 {{main actor-isolated var 'a' can not be mutated from a non-isolated context}}
26
- // expected-error @-2:9 {{expression is 'async' but is not marked with 'await'}}{{9-9=await }}
26
+ // expected-warning @-2:9 {{expression is 'async' but is not marked with 'await'}}{{9-9=await }}
27
27
// expected-note@-3:9 {{property access is 'async'}}
28
28
}
29
29
You can’t perform that action at this time.
0 commit comments