title: Why can't I add Contract.Requires in an overridden method?
body: <p>I'm using code contract (actually, learning using this).</p>
  
  <p>I'm facing something weird to me... I  override a method, defined in a 3rd party assembly. I want to add a <code>Contract.Require</code> statement like this:</p>
  
  <pre><code>public class MyClass: MyParentClass
  {
      protected override void DoIt(MyParameter param)
      {
          Contract.Requires&lt;ArgumentNullException&gt;(param != null);
  
          this.ExecuteMyTask(param.Something);
      }
  
      protected void ExecuteMyTask(MyParameter param)
      {
          Contract.Requires&lt;ArgumentNullException&gt;(param != null);
          /* body of the method */
      }
  }
  </code></pre>
  
  <p>However, I'm getting warnings like this:</p>
  
  <blockquote>
    <p>Warning   1   CodeContracts: 
    Method 'MyClass.DoIt(MyParameter)' overrides 'MyParentClass.DoIt(MyParameter))', thus cannot add Requires.</p>
  </blockquote>
  
  <p><strong>[edit]</strong> changed the code a bit to show alternatives issues <strong>[/edit]</strong></p>
  
  <p>If I remove the <code>Contract.Requires</code> in the DoIt method, I get another warning, telling me I have to provide unproven <code>param != null</code>
  I don't understand this warning. What is the cause, and can I solve it?</p>