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 {
102
102
nonisolated protocol Refined : GloballyIsolated { }
103
103
nonisolated protocol WhyNot { }
104
104
105
+ nonisolated protocol NonisolatedWithMembers {
106
+ func test( )
107
+ }
108
+
105
109
struct A : Refined {
106
110
var x : NonSendable
107
111
init ( x: NonSendable ) {
@@ -171,6 +175,16 @@ struct NonisolatedStruct {
171
175
}
172
176
}
173
177
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
+
174
188
// MARK: - Extensions
175
189
176
190
nonisolated extension GloballyIsolated {
You can’t perform that action at this time.
0 commit comments