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 {
10761076 // / global or static 'let' variables, which was previously accepted in
10771077 // / compiler versions before 5.10, or for declarations marked preconcurrency.
10781078 bool downgradeAsyncAccessToWarning (Decl *decl) {
1079+ if (decl->preconcurrency ()) {
1080+ return true ;
1081+ }
1082+
10791083 if (auto *var = dyn_cast<VarDecl>(decl)) {
10801084 ActorReferenceResult::Options options = llvm::None;
10811085 // The newly-diagnosed cases are invalid regardless of the module context
@@ -1086,7 +1090,7 @@ class ApplyClassifier {
10861090 }
10871091 }
10881092
1089- return decl-> preconcurrency () ;
1093+ return false ;
10901094 }
10911095
10921096 Classification classifyLookup (LookupExpr *E) {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ func nonIsolatedAsync() async {
2323 await print ( a)
2424 a = a + 10
2525 // 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 }}
2727 // expected-note@-3:9 {{property access is 'async'}}
2828}
2929
You can’t perform that action at this time.
0 commit comments