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 @@ -100,6 +100,10 @@ nonisolated struct S1: GloballyIsolated {
100100nonisolated protocol Refined : GloballyIsolated { }
101101nonisolated protocol WhyNot { }
102102
103+ nonisolated protocol NonisolatedWithMembers {
104+ func test( )
105+ }
106+
103107struct A : Refined {
104108 var x : NonSendable
105109 init ( x: NonSendable ) {
@@ -169,6 +173,16 @@ struct NonisolatedStruct {
169173 }
170174}
171175
176+ @MainActor
177+ struct TestIsolated : NonisolatedWithMembers {
178+ var x : NonSendable // expected-note {{property declared here}}
179+
180+ // requirement behaves as if it's explicitly `nonisolated` which gets inferred onto the witness
181+ func test( ) {
182+ _ = x // expected-error {{main actor-isolated property 'x' can not be referenced from a nonisolated context}}
183+ }
184+ }
185+
172186// MARK: - Extensions
173187
174188nonisolated extension GloballyIsolated {
You can’t perform that action at this time.
0 commit comments