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) {
4891
4891
// / are directly specified on the type.
4892
4892
static std::optional<ActorIsolation>
4893
4893
getIsolationFromConformances (NominalTypeDecl *nominal) {
4894
+ auto &ctx = nominal->getASTContext ();
4895
+
4894
4896
if (isa<ProtocolDecl>(nominal))
4895
4897
return std::nullopt;
4896
4898
@@ -4904,8 +4906,13 @@ getIsolationFromConformances(NominalTypeDecl *nominal) {
4904
4906
// If the superclass has opted out of global actor inference, such as
4905
4907
// by conforming to the protocol in an extension, then the subclass should
4906
4908
// 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)) {
4908
4914
continue ;
4915
+ }
4909
4916
4910
4917
auto *proto = conformance->getProtocol ();
4911
4918
switch (auto protoIsolation = getActorIsolation (proto)) {
You can’t perform that action at this time.
0 commit comments