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) {
68896889 // backing storage is a stored 'var' that is part of the internal state
68906890 // of the actor which could only be accessed in actor's isolation context.
68916891 if (var->hasAttachedPropertyWrapper ()) {
6892- diagnoseAndRemoveAttr (attr, diag::nonisolated_wrapped_property);
6892+ diagnoseAndRemoveAttr (attr, diag::nonisolated_wrapped_property)
6893+ .warnUntilSwiftVersionIf (attr->isImplicit (), 6 );
68936894 return ;
68946895 }
68956896
Original file line number Diff line number Diff line change @@ -2343,6 +2343,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
23432343 (void ) VD->getPropertyWrapperAuxiliaryVariables ();
23442344 (void ) VD->getPropertyWrapperInitializerInfo ();
23452345 (void ) VD->getImplInfo ();
2346+ (void ) getActorIsolation (VD);
23462347
23472348 // Visit auxiliary decls first
23482349 VD->visitAuxiliaryDecls ([&](VarDecl *var) {
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ struct HasWrapperOnActor {
390390 synced = 17
391391 }
392392
393- @WrapperActor var actorSynced : Int = 0
393+ @WrapperActor var actorSynced : Int = 0 // expected-warning{{'nonisolated' is not supported on properties with property wrappers}}
394394
395395 func testActorSynced( ) {
396396 _ = actorSynced
@@ -489,10 +489,10 @@ struct SimplePropertyWrapper {
489489class WrappedContainsNonisolatedAttr {
490490 @SimplePropertyWrapper nonisolated var value
491491 // 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}}
493493
494494 nonisolated func test( ) {
495- _ = value // expected-error {{main actor-isolated property 'value' can not be referenced from a non-isolated context}}
495+ _ = value
496496 _ = $value // expected-error {{main actor-isolated property '$value' can not be referenced from a non-isolated context}}
497497 }
498498}
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ struct HasWrapperOnActor {
117117 synced = 17
118118 }
119119
120- @WrapperActor var actorSynced : Int = 0
120+ @WrapperActor var actorSynced : Int = 0 // expected-error{{'nonisolated' is not supported on properties with property wrappers}}
121121
122122 func testActorSynced( ) {
123123 _ = actorSynced
You can’t perform that action at this time.
0 commit comments