Closed alex-bogomaz closed 7 years ago
I think we regard this as a bug fix, and expect historical consumers of quotations to be able to process either form
thanks for clarification
closing
Sorry for commenting on this long closed issue, but FYI - it appears that there is information loss in the new quotation representation such that it is not possible to decompile <@ ftupled (1,2) @>
as "ftupled (1,2)". That is, when we have a function partially applied with a tuple in the first arg, 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]];}
Following quotation expression is parsed/interpreted/decompiled differently across F# 4.0 and F# 4.1:
Repro steps
val ftupled : a:int * b:int -> c:int -> d:int -> int
Found this when compiling https://github.com/SwensenSoftware/unquote/ using VS 2017