Please provide a succinct description of the issue.
Repro steps
open System.Threading.Tasks
let myFunction (f, i) =
task {
do! f ""
return ()
}
[<EntryPoint>]
let main argv =
let myTuple = (fun s -> Task.FromResult()), 1
(myFunction myTuple).Wait()
0
Expected behavior
The programs runs to end successfully. This code worked with Fsharp 5.0.1 and TaskBuilder.fs
Actual behavior
With Fsharp.Core 6.0 it fails in runtime with error
Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.Tuple`2[Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.Threading.Tasks.Task`1[Microsoft.FSharp.Core.Unit]],System.Int32]' to type 'S
ystem.Tuple`2[Microsoft.FSharp.Core.FSharpFunc`2[System.String,System.Threading.Tasks.Task`1[Microsoft.FSharp.Core.Unit]],System.Object]'.
Known workarounds
It works when f or i parameter has type annotation
Related information
Provide any related information (optional):
- Windows 10
- Microsoft (R) Build Engine version 17.0.0-preview-21460-01+8f208e609 for .NET
- Jetbrains Rider
Please provide a succinct description of the issue.
Repro steps
Expected behavior
The programs runs to end successfully. This code worked with Fsharp 5.0.1 and TaskBuilder.fs
Actual behavior
With Fsharp.Core 6.0 it fails in runtime with error
Known workarounds
It works when f or i parameter has type annotation
Related information
Provide any related information (optional):