Closed
Description
open System
let x() =
let y () = 3
let (a,b) =
if DateTime.Now.Day > 1 then
y(), 2
else
2, y()
a + b
I would expect a direct tuple/detuple in a binding, like the above, to be rewritten to mutable a and b mutated directly from their branches.
In cases where detupling is successful (example of a case below) the entire function compiles down to the result of a + b
.
let x() =
let y () = 3
let (a,b) =
y(), 2
a + b
Related:
dotnet/coreclr#21950