mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Sema] NFC: Add a variant of addNonIsolatedToSynthesized that checks for @preconcurrency conformances
If derived conformance is marked as `@preconcurrency` instead of marking synthesized members as `nonisolated` the compiler should insert dynamic checks.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "TypeCheckObjC.h"
|
||||
#include "TypeCheckType.h"
|
||||
#include "TypeChecker.h"
|
||||
#include "DerivedConformances.h"
|
||||
#include "swift/AST/ASTMangler.h"
|
||||
#include "swift/AST/ASTPrinter.h"
|
||||
#include "swift/AST/AvailabilityInference.h"
|
||||
@@ -1728,6 +1729,15 @@ bool swift::hasLetStoredPropertyWithInitialValue(NominalTypeDecl *nominal) {
|
||||
});
|
||||
}
|
||||
|
||||
bool swift::addNonIsolatedToSynthesized(DerivedConformance &derived,
|
||||
ValueDecl *value) {
|
||||
if (auto *conformance = derived.Conformance) {
|
||||
if (conformance && conformance->isPreconcurrency())
|
||||
return false;
|
||||
}
|
||||
return addNonIsolatedToSynthesized(derived.Nominal, value);
|
||||
}
|
||||
|
||||
bool swift::addNonIsolatedToSynthesized(NominalTypeDecl *nominal,
|
||||
ValueDecl *value) {
|
||||
if (!getActorIsolation(nominal).isActorIsolated())
|
||||
|
||||
Reference in New Issue
Block a user