diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index 25d98ffcee5c6..8437b352a5ed9 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -6889,7 +6889,8 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) { // backing storage is a stored 'var' that is part of the internal state // of the actor which could only be accessed in actor's isolation context. if (var->hasAttachedPropertyWrapper()) { - diagnoseAndRemoveAttr(attr, diag::nonisolated_wrapped_property); + diagnoseAndRemoveAttr(attr, diag::nonisolated_wrapped_property) + .warnUntilSwiftVersionIf(attr->isImplicit(), 6); return; } diff --git a/lib/Sema/TypeCheckDeclPrimary.cpp b/lib/Sema/TypeCheckDeclPrimary.cpp index 15057226eefa5..affc9775a9853 100644 --- a/lib/Sema/TypeCheckDeclPrimary.cpp +++ b/lib/Sema/TypeCheckDeclPrimary.cpp @@ -2343,6 +2343,7 @@ class DeclChecker : public DeclVisitor { (void) VD->getPropertyWrapperAuxiliaryVariables(); (void) VD->getPropertyWrapperInitializerInfo(); (void) VD->getImplInfo(); + (void) getActorIsolation(VD); // Visit auxiliary decls first VD->visitAuxiliaryDecls([&](VarDecl *var) { diff --git a/test/Concurrency/global_actor_inference.swift b/test/Concurrency/global_actor_inference.swift index 81c127645a23f..27df72d8eebe6 100644 --- a/test/Concurrency/global_actor_inference.swift +++ b/test/Concurrency/global_actor_inference.swift @@ -390,7 +390,7 @@ struct HasWrapperOnActor { synced = 17 } - @WrapperActor var actorSynced: Int = 0 + @WrapperActor var actorSynced: Int = 0 // expected-warning{{'nonisolated' is not supported on properties with property wrappers}} func testActorSynced() { _ = actorSynced @@ -489,10 +489,10 @@ struct SimplePropertyWrapper { class WrappedContainsNonisolatedAttr { @SimplePropertyWrapper nonisolated var value // expected-error@-1 {{'nonisolated' is not supported on properties with property wrappers}} - // expected-note@-2 2{{property declared here}} + // expected-note@-2 {{property declared here}} nonisolated func test() { - _ = value // expected-error {{main actor-isolated property 'value' can not be referenced from a non-isolated context}} + _ = value _ = $value // expected-error {{main actor-isolated property '$value' can not be referenced from a non-isolated context}} } } diff --git a/test/Concurrency/global_actor_inference_swift6.swift b/test/Concurrency/global_actor_inference_swift6.swift index 82852b869cfba..808a3fa09f87c 100644 --- a/test/Concurrency/global_actor_inference_swift6.swift +++ b/test/Concurrency/global_actor_inference_swift6.swift @@ -117,7 +117,7 @@ struct HasWrapperOnActor { synced = 17 } - @WrapperActor var actorSynced: Int = 0 + @WrapperActor var actorSynced: Int = 0 // expected-error{{'nonisolated' is not supported on properties with property wrappers}} func testActorSynced() { _ = actorSynced