Skip to content

Commit

Permalink
Prevent expression reduce when looking for ordering method (#6255)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-brink-talogy authored Jun 16, 2023
1 parent 8a98efc commit fda99f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public ReplaceVariableExpressionVisitor(
_parameter = parameter;
}

protected override Expression VisitExtension(Expression node) => node.CanReduce ? base.VisitExtension(node) : node;

protected override Expression VisitParameter(ParameterExpression node)
{
if (node == _parameter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ private sealed class OrderingMethodFinder : ExpressionVisitor
return base.Visit(node);
}

protected override Expression VisitExtension(Expression node) => node.CanReduce ? base.VisitExtension(node) : node;

protected override Expression VisitMethodCall(MethodCallExpression node)
{
var name = node.Method.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public ReplaceVariableExpressionVisitor(
_parameter = parameter;
}

protected override Expression VisitExtension(Expression node) => node.CanReduce ? base.VisitExtension(node) : node;

protected override Expression VisitParameter(ParameterExpression node)
{
if (node == _parameter)
Expand Down

0 comments on commit fda99f3

Please sign in to comment.