In Xcode Version 13.0 beta 3 (13A5192i), I just paste this example:
@MainActor
class Test {
fileprivate var value: Int?
func tryMe() {
Task {
self.value = nil
}
}
}
from Why don't I need an await in this example? - #2 by nikitamounier
and get these compile error:
**Playground execution failed:**
**error: MainActorInheritActorContext.xcplaygroundpage:3:1: error: unknown attribute 'MainActor'**
**@MainActor**
**^**
**error: MainActorInheritActorContext.xcplaygroundpage:8:9: error: cannot find 'Task' in scope**
**Task {**
**^~~~**
Edit: this compiles fine in a iOS project. So why Xcode Playground not compile the same code?