[Concurrency] Allow isolated default arguments to be used from across isolation

boundaries.
This commit is contained in:
Holly Borla
2023-10-24 22:16:00 -07:00
parent 936739e9fb
commit 49d6399a88
11 changed files with 122 additions and 60 deletions

View File

@@ -339,7 +339,14 @@ static ConstructorDecl *createImplicitConstructor(NominalTypeDecl *decl,
if (ICK == ImplicitConstructorKind::Memberwise) {
ctor->setIsMemberwiseInitializer();
addNonIsolatedToSynthesized(decl, ctor);
// FIXME: If 'IsolatedDefaultValues' is enabled, the memberwise init
// should be 'nonisolated' if none of the memberwise-initialized properties
// are global actor isolated and have non-Sendable type, and none of the
// initial values require global actor isolation.
if (!ctx.LangOpts.hasFeature(Feature::IsolatedDefaultValues)) {
addNonIsolatedToSynthesized(decl, ctor);
}
}
// If we are defining a default initializer for a class that has a superclass,