We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e42a19 commit 083962dCopy full SHA for 083962d
test/Concurrency/nonisolated_rules.swift
@@ -196,6 +196,20 @@ struct TestEnum {
196
}
197
198
199
+nonisolated protocol NonisolatedWithMembers {
200
+ func test()
201
+}
202
+
203
+@MainActor
204
+struct TestIsolated : NonisolatedWithMembers {
205
+ var x: NonSendable // expected-note {{property declared here}}
206
207
+ // requirement behaves as if it's explicitly `nonisolated` which gets inferred onto the witness
208
+ func test() {
209
+ _ = x // expected-error {{main actor-isolated property 'x' can not be referenced from a nonisolated context}}
210
+ }
211
212
213
// MARK: - Classes
214
215
nonisolated class K: GloballyIsolated {
0 commit comments