I'm trying new Swift 5.5 await async features and I get that compilation error when I try this in a Playground:
let task1 = Task {
// ...
}
'Task' cannot be constructed because it has no accessible initializers
I got the example from https://www.hackingwithswift.com/articles/233/whats-new-in-swift-5-5
Any idea?
It seems to me that you are referencing another Foundation named Task.
_Concurrency.Task {
//brabra
}
Did you use it like this
typealias Task = _Concurrency.Task
Specify it like this and use it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With