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