-
Notifications
You must be signed in to change notification settings - Fork 830
Labels
Milestone
Description
Repro steps and actual behavior
FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation raises a NotSupportedException when the quotation contains sequencing or variable/property/field mutation:
let eval = LeafExpressionConverter.EvaluateQuotation
eval <@ a; b @>
eval <@ a <- b @>
eval <@ a.b <- c @>
// System.NotSupportedException: Could not convert the following F# Quotation to a LINQ Expression TreeAlso, when the quotation is of type unit and the compiled expression tree is of type System.Void (such as a void method call) or something else (a mutation), Linq raises an ArgumentException:
eval <@ System.Console.WriteLine("Hello, World") @>
// System.ArgumentException: Expression of type 'System.Void' cannot be used for return type 'Microsoft.FSharp.Core.Unit'Expected behavior
The function should correctly compile the expression to Linq tree and execute in these cases.
Known workarounds
Avoid these problematic constructs in the quotation. For example, write a.set_b(c) instead of a.b <- c.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New