title: "Incorrect number of parameters supplied for lambda declaration"
body: <p>When I have this,</p>
  
  <pre><code>public static object Create()
  {
      return new object();
  }
  </code></pre>
  
  <p>this works:</p>
  
  <pre><code>var m = typeof(Class).GetMethod("Create");
  var e = Expression.Call(m);
  Func&lt;object&gt; f = Expression.Lambda&lt;Func&lt;object&gt;&gt;(e).Compile();
  </code></pre>
  
  <p>But when I have this,</p>
  
  <pre><code>public static object Create(Type t)
  {
      return new object();
  }
  </code></pre>
  
  <p>this fails:</p>
  
  <pre><code>var m = typeof(Class).GetMethod("Create");
  var e = Expression.Call(m, Expression.Parameter(typeof(Type)));
  var t = Expression.Parameter(typeof(Foo));
  Func&lt;object&gt; f = Expression.Lambda&lt;Func&lt;object&gt;&gt;(e, t).Compile();
  </code></pre>
  
  <p>I get <em>An unhandled exception of type 'System.ArgumentException' occurred in System.Core.dll. Additional information: Incorrect number of parameters supplied for lambda declaration</em>. The parameter <code>t</code> is just expression for a dummy type <code>Foo</code>. I think that's irrelevant. Where have I gone wrong here?</p>