mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #70313 from sophiapoirier/downgrade-preconcurrency-effect-errors-revision
[Concurrency] correct AbstractFunction::isPreconcurrency logic
This commit is contained in:
@@ -1076,6 +1076,10 @@ public:
|
||||
/// global or static 'let' variables, which was previously accepted in
|
||||
/// compiler versions before 5.10, or for declarations marked preconcurrency.
|
||||
bool downgradeAsyncAccessToWarning(Decl *decl) {
|
||||
if (decl->preconcurrency()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (auto *var = dyn_cast<VarDecl>(decl)) {
|
||||
ActorReferenceResult::Options options = llvm::None;
|
||||
// The newly-diagnosed cases are invalid regardless of the module context
|
||||
@@ -1086,7 +1090,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
return decl->preconcurrency();
|
||||
return false;
|
||||
}
|
||||
|
||||
Classification classifyLookup(LookupExpr *E) {
|
||||
|
||||
@@ -23,7 +23,7 @@ func nonIsolatedAsync() async {
|
||||
await print(a)
|
||||
a = a + 10
|
||||
// expected-error@-1:5 {{main actor-isolated var 'a' can not be mutated from a non-isolated context}}
|
||||
// expected-error@-2:9 {{expression is 'async' but is not marked with 'await'}}{{9-9=await }}
|
||||
// expected-warning@-2:9 {{expression is 'async' but is not marked with 'await'}}{{9-9=await }}
|
||||
// expected-note@-3:9 {{property access is 'async'}}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user