Shouldn't there be a warning here?
func foo() async -> Int {
0
}
func bar() {
Task {
await foo() // no warning here for unused result
}
}
Shouldn't there be a warning here?
func foo() async -> Int {
0
}
func bar() {
Task {
await foo() // no warning here for unused result
}
}
The result of the call to foo
is the return value of the closure passed to the Task
initializer. This initializer is annotated with @discardableResult
.
Indeed that was it, thank you.