Closed stephen-swensen closed 5 years ago
Unfortunately, it doesn't appear possible to correctly decompile this case of a function partially applied with a tuple in the first arg, because it has the same exact representation as a function partially applied with all non-tuple args:
let ftupled (a,b) c d = a + b + c + d + 1
<@ ftupled (1,2) @>
> <@ ftupled (1,2) @>;;
val it : Quotations.Expr<(int -> int -> int)> =
Let (a, Value (1),
Let (b, Value (2),
Lambda (c, Lambda (d, Call (None, ftupled, [a, b, c, d])))))
{CustomAttributes = [NewTuple (Value ("DebugRange"),
NewTuple (Value ("stdin"), Value (6), Value (3), Value (6), Value (16)))];
Raw = ...;
Type = Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32]];}
and
let ftupled a b c d = a + b + c + d + 1
<@ ftupled 1 2 @>
> <@ ftupled 1 2 @>;;
val it : Quotations.Expr<(int -> int -> int)> =
Let (a, Value (1),
Let (b, Value (2),
Lambda (c, Lambda (d, Call (None, ftupled, [a, b, c, d])))))
{CustomAttributes = [NewTuple (Value ("DebugRange"),
NewTuple (Value ("stdin"), Value (8), Value (3), Value (8), Value (14)))];
Raw = ...;
Type = Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,Microsoft.FSharp.Core.FSharpFunc`2[System.Int32,System.Int32]];}
See https://github.com/Microsoft/visualfsharp/issues/3698