File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6889,7 +6889,8 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
6889
6889
// backing storage is a stored 'var' that is part of the internal state
6890
6890
// of the actor which could only be accessed in actor's isolation context.
6891
6891
if (var->hasAttachedPropertyWrapper ()) {
6892
- diagnoseAndRemoveAttr (attr, diag::nonisolated_wrapped_property);
6892
+ diagnoseAndRemoveAttr (attr, diag::nonisolated_wrapped_property)
6893
+ .warnUntilSwiftVersionIf (attr->isImplicit (), 6 );
6893
6894
return ;
6894
6895
}
6895
6896
Original file line number Diff line number Diff line change @@ -2343,6 +2343,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
2343
2343
(void ) VD->getPropertyWrapperAuxiliaryVariables ();
2344
2344
(void ) VD->getPropertyWrapperInitializerInfo ();
2345
2345
(void ) VD->getImplInfo ();
2346
+ (void ) getActorIsolation (VD);
2346
2347
2347
2348
// Visit auxiliary decls first
2348
2349
VD->visitAuxiliaryDecls ([&](VarDecl *var) {
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ struct HasWrapperOnActor {
390
390
synced = 17
391
391
}
392
392
393
- @WrapperActor var actorSynced : Int = 0
393
+ @WrapperActor var actorSynced : Int = 0 // expected-warning{{'nonisolated' is not supported on properties with property wrappers}}
394
394
395
395
func testActorSynced( ) {
396
396
_ = actorSynced
@@ -489,10 +489,10 @@ struct SimplePropertyWrapper {
489
489
class WrappedContainsNonisolatedAttr {
490
490
@SimplePropertyWrapper nonisolated var value
491
491
// expected-error@-1 {{'nonisolated' is not supported on properties with property wrappers}}
492
- // expected-note@-2 2 {{property declared here}}
492
+ // expected-note@-2 {{property declared here}}
493
493
494
494
nonisolated func test( ) {
495
- _ = value // expected-error {{main actor-isolated property 'value' can not be referenced from a non-isolated context}}
495
+ _ = value
496
496
_ = $value // expected-error {{main actor-isolated property '$value' can not be referenced from a non-isolated context}}
497
497
}
498
498
}
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ struct HasWrapperOnActor {
117
117
synced = 17
118
118
}
119
119
120
- @WrapperActor var actorSynced : Int = 0
120
+ @WrapperActor var actorSynced : Int = 0 // expected-error{{'nonisolated' is not supported on properties with property wrappers}}
121
121
122
122
func testActorSynced( ) {
123
123
_ = actorSynced
You can’t perform that action at this time.
0 commit comments