File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -420,6 +420,7 @@ EXPERIMENTAL_FEATURE(LifetimeDependence, true)
420420
421421// / Enable inout lifetime dependence - @lifetime(&arg)
422422EXPERIMENTAL_FEATURE(InoutLifetimeDependence, true )
423+ EXPERIMENTAL_FEATURE(LifetimeDependenceMutableAccessors, true )
423424
424425// / Enable the `@_staticExclusiveOnly` attribute.
425426EXPERIMENTAL_FEATURE(StaticExclusiveOnly, true )
Original file line number Diff line number Diff line change @@ -294,6 +294,23 @@ static bool usesFeatureInoutLifetimeDependence(Decl *decl) {
294294 }
295295}
296296
297+ static bool usesFeatureLifetimeDependenceMutableAccessors (Decl *decl) {
298+ if (!isa<VarDecl>(decl)) {
299+ return false ;
300+ }
301+ auto var = cast<VarDecl>(decl);
302+ if (!var->isGetterMutating ()) {
303+ return false ;
304+ }
305+ if (auto dc = var->getDeclContext ()) {
306+ if (auto nominal = dc->getSelfNominalTypeDecl ()) {
307+ auto sig = nominal->getGenericSignature ();
308+ return !var->getInterfaceType ()->isEscapable (sig);
309+ }
310+ }
311+ return false ;
312+ }
313+
297314UNINTERESTING_FEATURE (DynamicActorIsolation)
298315UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
299316UNINTERESTING_FEATURE(ClosureIsolation)
You can’t perform that action at this time.
0 commit comments