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)
420
420
421
421
// / Enable inout lifetime dependence - @lifetime(&arg)
422
422
EXPERIMENTAL_FEATURE(InoutLifetimeDependence, true )
423
+ EXPERIMENTAL_FEATURE(LifetimeDependenceMutableAccessors, true )
423
424
424
425
// / Enable the `@_staticExclusiveOnly` attribute.
425
426
EXPERIMENTAL_FEATURE(StaticExclusiveOnly, true )
Original file line number Diff line number Diff line change @@ -294,6 +294,23 @@ static bool usesFeatureInoutLifetimeDependence(Decl *decl) {
294
294
}
295
295
}
296
296
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
+
297
314
UNINTERESTING_FEATURE (DynamicActorIsolation)
298
315
UNINTERESTING_FEATURE(NonfrozenEnumExhaustivity)
299
316
UNINTERESTING_FEATURE(ClosureIsolation)
You can’t perform that action at this time.
0 commit comments