File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ nonisolated struct S1: GloballyIsolated {
102102nonisolated protocol Refined : GloballyIsolated { }
103103nonisolated protocol WhyNot { }
104104
105+ nonisolated protocol NonisolatedWithMembers {
106+ func test( )
107+ }
108+
105109struct A : Refined {
106110 var x : NonSendable
107111 init ( x: NonSendable ) {
@@ -171,6 +175,16 @@ struct NonisolatedStruct {
171175 }
172176}
173177
178+ @MainActor
179+ struct TestIsolated : NonisolatedWithMembers {
180+ var x : NonSendable // expected-note {{property declared here}}
181+
182+ // requirement behaves as if it's explicitly `nonisolated` which gets inferred onto the witness
183+ func test( ) {
184+ _ = x // expected-error {{main actor-isolated property 'x' can not be referenced from a nonisolated context}}
185+ }
186+ }
187+
174188// MARK: - Extensions
175189
176190nonisolated extension GloballyIsolated {
You can’t perform that action at this time.
0 commit comments