title: Why doesn't the c# compiler check "staticness" of the method at call sites with a dynamic argument?
body: <p>Why doesn't the C# compiler tell me that this piece of code is invalid?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          dynamic d = 1;
          MyMethod(d);
      }
  
      public void MyMethod(int i) 
      {
          Console.WriteLine("int");
      }
  }
  </code></pre>
  
  <p>The call to <code>MyMethod</code> fails at runtime because I am trying to call a non-static method from a static method. That is very reasonable, but why doesn't the compiler consider this an error at compile time?</p>
  
  <p>The following will not compile </p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          dynamic d = 1;
          MyMethod(d);
      }
  }
  </code></pre>
  
  <p>so despite the dynamic dispatch, the compiler does check that <code>MyMethod</code> exists. Why doesn't it verify the "staticness"?</p>