To my surprise I'm allowed to access Main actor-isolated property from a non isolated context in one case (but not another). What's the rationale here, or is it a WIP, not fully implemented feature?
@MainActor class C {
var x = [1:2]
}
@MainActor class D: C {
var y = [1:2]
deinit {
print(y[1]) // ok?!
print(x[1]) // expected error: Main actor-isolated property 'x' can not be referenced from a nonisolated context
}
}
await MainActor.run {
var c: C? = C()
DispatchQueue.global().async {
c = nil
}
}
RunLoop.main.run(until: Date.distantFuture)