mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #80847 from glessard/rdar149227278-nonescapable-mutating-accessor-62
[6.2, LifetimeDependenceMutableAccessors] defensive feature flag
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user