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 @@ -419,6 +419,7 @@ EXPERIMENTAL_FEATURE(LifetimeDependence, true)
419
419
420
420
// / Enable inout lifetime dependence - @lifetime(&arg)
421
421
EXPERIMENTAL_FEATURE(InoutLifetimeDependence, true )
422
+ EXPERIMENTAL_FEATURE(LifetimeDependenceMutableAccessors, true )
422
423
423
424
// / Enable the `@_staticExclusiveOnly` attribute.
424
425
EXPERIMENTAL_FEATURE(StaticExclusiveOnly, true )
Original file line number Diff line number Diff line change @@ -293,6 +293,23 @@ static bool usesFeatureInoutLifetimeDependence(Decl *decl) {
293
293
}
294
294
}
295
295
296
+ static bool usesFeatureLifetimeDependenceMutableAccessors (Decl *decl) {
297
+ if (!isa<VarDecl>(decl)) {
298
+ return false ;
299
+ }
300
+ auto var = cast<VarDecl>(decl);
301
+ if (!var->isGetterMutating ()) {
302
+ return false ;
303
+ }
304
+ if (auto dc = var->getDeclContext ()) {
305
+ if (auto nominal = dc->getSelfNominalTypeDecl ()) {
306
+ auto sig = nominal->getGenericSignature ();
307
+ return !var->getInterfaceType ()->isEscapable (sig);
308
+ }
309
+ }
310
+ return false ;
311
+ }
312
+
296
313
UNINTERESTING_FEATURE (DynamicActorIsolation)
297
314
UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
298
315
UNINTERESTING_FEATURE(ClosureIsolation)
You can’t perform that action at this time.
0 commit comments