-
Notifications
You must be signed in to change notification settings - Fork 847
Open
Labels
Area-QuotationsQuotations (compiler support or library). See also "queries"Quotations (compiler support or library). See also "queries"BugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
Trying to extract a Linq expression which contains a nested Linq expression results in expression with Quotation related calls.
Repro steps
open System
open System.Linq.Expressions
type LinqExpr =
static member fromFunc<'T, 'U>(e : Expression<Func<'T, 'U>>) = e
let expr = LinqExpr.fromFunc(fun () -> LinqExpr.fromFunc(fun y -> y + 1))
val it : Expression<Func<unit,Expression<Func<int,int>>>> =
unitVar0 => fromFunc(QuotationToLambdaExpression(SubstHelper(NewDelegate (Func`2, y, Call (None, op_Addition, [y, Value (1)])), new [] {}, new [] {})))
{Body = fromFunc(QuotationToLambdaExpression(SubstHelper(NewDelegate (Func`2, y, Call (None, op_Addition, [y, Value (1)])), new [] {}, new [] {})));
CanReduce = false;
Name = null;
NodeType = Lambda;
Parameters = seq [unitVar0];
ReturnType = System.Linq.Expressions.Expression`1[System.Func`2[System.Int32,System.Int32]];
TailCall = false;
Type = System.Func`2[Microsoft.FSharp.Core.Unit,System.Linq.Expressions.Expression`1[System.Func`2[System.Int32,System.Int32]]];}
Expected behavior
The resulting expression tree should not contain quotation related calls, but probably use an ExpressionType.Quote for the nested expression.
Actual behavior
Expression tree contains this expression tree:
QuotationToLambdaExpression(SubstHelper(NewDelegate (Func`2, y, Call (None, op_Addition, [y, Value (1)])), new [] {}, new [] {}))Known workarounds
None.
Related information
Provide any related information
- Windows 10
- .NET Framework, any version
- Visual Studio 2015/2017
- Severity: low
Metadata
Metadata
Assignees
Labels
Area-QuotationsQuotations (compiler support or library). See also "queries"Quotations (compiler support or library). See also "queries"BugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
Status
In Progress