title: Is there a bug with nested invoke of LambdaExpression?
body: <p>I tried to compile and calculate LambdaExpression like:</p>
  
  <blockquote>
    <p>Plus(10, Plus(1,2))</p>
  </blockquote>
  
  <p>But result is 4, not 13.</p>
  
  <p>Code:</p>
  
  <pre><code>using System;
  using System.Linq.Expressions;
  
  namespace CheckLambdaExpressionBug
  {
      class Program
      {
          static void Main(string[] _args)
          {
              ParameterExpression p1 = Expression.Parameter(typeof (int), "p1");
              ParameterExpression p2 = Expression.Parameter(typeof (int), "p2");
              LambdaExpression lambda = Expression.Lambda(Expression.Call(typeof(Program).GetMethod("Plus"), p1, p2), p1, p2);
  
              InvocationExpression exp1 = Expression.Invoke(
                  lambda,
                  Expression.Constant(1),
                  Expression.Constant(2)
                  );
  
              InvocationExpression exp2 = Expression.Invoke(
                  lambda,
                  Expression.Constant(10),
                  exp1
                  );
  
              var func = (Func&lt;int&gt;) Expression.Lambda(exp2).Compile();
  
              int v = func();
              Console.Out.WriteLine("Result = {0}", v);
          }
  
          public static int Plus(int a, int b)
          {
              return a + b;
          }
      }
  }
  </code></pre>