Merge pull request #69391 from hborla/isolated-default-value-revision

[Concurrency] Allow isolated default arguments to be used from across isolation boundaries.
This commit is contained in:
Holly Borla
2023-10-26 09:33:25 -07:00
committed by GitHub
12 changed files with 147 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,