File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4891,6 +4891,8 @@ getIsolationFromWitnessedRequirements(ValueDecl *value) {
48914891// / are directly specified on the type.
48924892static std::optional<ActorIsolation>
48934893getIsolationFromConformances (NominalTypeDecl *nominal) {
4894+ auto &ctx = nominal->getASTContext ();
4895+
48944896 if (isa<ProtocolDecl>(nominal))
48954897 return std::nullopt ;
48964898
@@ -4904,8 +4906,13 @@ getIsolationFromConformances(NominalTypeDecl *nominal) {
49044906 // If the superclass has opted out of global actor inference, such as
49054907 // by conforming to the protocol in an extension, then the subclass should
49064908 // not infer isolation from the protocol.
4907- if (conformance->getKind () == ProtocolConformanceKind::Inherited)
4909+ //
4910+ // Gate this change behind an upcoming feature flag; isolation inference
4911+ // changes can break source in language modes < 6.
4912+ if (conformance->getKind () == ProtocolConformanceKind::Inherited &&
4913+ ctx.LangOpts .hasFeature (Feature::GlobalActorIsolatedTypesUsability)) {
49084914 continue ;
4915+ }
49094916
49104917 auto *proto = conformance->getProtocol ();
49114918 switch (auto protoIsolation = getActorIsolation (proto)) {
You can’t perform that action at this time.
0 commit comments