Merge pull request #80847 from glessard/rdar149227278-nonescapable-mutating-accessor-62

[6.2, LifetimeDependenceMutableAccessors] defensive feature flag
This commit is contained in:
Guillaume Lessard
2025-04-29 12:30:10 -07:00
committed by GitHub
3 changed files with 19 additions and 0 deletions

View File

@@ -294,6 +294,23 @@ static bool usesFeatureInoutLifetimeDependence(Decl *decl) {
}
}
static bool usesFeatureLifetimeDependenceMutableAccessors(Decl *decl) {
if (!isa<VarDecl>(decl)) {
return false;
}
auto var = cast<VarDecl>(decl);
if (!var->isGetterMutating()) {
return false;
}
if (auto dc = var->getDeclContext()) {
if (auto nominal = dc->getSelfNominalTypeDecl()) {
auto sig = nominal->getGenericSignature();
return !var->getInterfaceType()->isEscapable(sig);
}
}
return false;
}
UNINTERESTING_FEATURE(DynamicActorIsolation)
UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
UNINTERESTING_FEATURE(ClosureIsolation)