title: Why does Code Contracts shows "Malformed contract. Found Requires after assignment" in method with params keywork?
body: <p>I've been troubleshooting with this error for hours and I can't seem to understand why this happens. Consider the following code:</p>
  
  <pre><code>using System;
  using System.Diagnostics.Contracts;
  using System.Linq.Expressions;
  
  namespace Contracts
  {
      class Data
      {
          public object TestData1 { get; set; }
          public object TestData2 { get; set; }
      }
  
      class Program
      {
          static void Main()
          {
              Data d = new Data();
              Method(d);
          }
  
          static void Method(Data d)
          {
              Contract.Requires(Methods.TestMethod1("test"));
              Contract.Requires(Methods.TestMethod2("test1", "test2"));
              Contract.Requires(Methods.TestMethod3(d, x =&gt; x.TestData1));
              Contract.Requires(Methods.TestMethod4(d, x =&gt; x.TestData1, x =&gt; x.TestData2));
          }
      }
  
      static class Methods
      {
          [Pure]
          public static bool TestMethod1(string str) { return true; }
  
          [Pure]
          public static bool TestMethod2(params string[] strs) { return true; }
  
          [Pure]
          public static bool TestMethod3&lt;T&gt;(T obj, Expression&lt;Func&lt;T, object&gt;&gt; exp) { return true; }
  
          [Pure]
          public static bool TestMethod4&lt;T&gt;(T obj, params Expression&lt;Func&lt;T, object&gt;&gt;[] exps) { return true; }
      }
  }
  </code></pre>
  
  <p>When I compile the project, the line "Contract.Requires(Methods.TestMethod4(d, x => x.TestData1, x => x.TestData2));" causes the following compilation error:</p>
  
  <blockquote>
    <p>Malformed contract. Found Requires after assignment in method 'Contracts.Program.Method(Contracts.Data)'.</p>
  </blockquote>
  
  <p>How come "Contract.Requires(Methods.TestMethod2("test1", "test2"));" doesn't cause an error but "Contract.Requires(Methods.TestMethod4(d, x => x.TestData1, x => x.TestData2));" does?</p>
  
  <p>Please help! :(</p>