open System.Threading.Tasks
let bar : Async<int> =
async {
let! _ = Task.Delay(5000) |> Async.AwaitTask
return 13
}
let foo : Async<int> =
async {
let! _ = Task.Delay(5000) |> Async.AwaitTask
let! result = bar |> Async.AwaitTask
return result
}
[<EntryPoint>]
let main argv =
let result = foo |> Async.RunSynchronously
printfn $"%A{result}"
0
Говорит что ошибка вызова
Async.AwaitTask в функции foo:
No overloads match for method 'AwaitTask'.
Known type of argument: Async Available overloads:
- static member Async.AwaitTask: task: Task -> Async // Argument 'task' doesn't match
- static member Async.AwaitTask: task: Task<'T> -> Async<'T> // Argument 'task' doesn't match