title: Reflection and dynamic method resolution
body: <p>It is safe to assume that when calling a method via reflection (or using dynamic) the most specific one is selected, as in ordinary code?</p>
  
  <p>Let's consider this code:</p>
  
  <pre><code>public class Animal {}
  public class Dog : Animal {}
  
  public class MyClass
  {
      public void SayHello(Dog animal)
      {
          Console.WriteLine("Hello dog!");
      }
  
      public void SayHello(Animal animal)
      {
          Console.WriteLine("Hello animal!");
      }
  }
  </code></pre>
  
  <p>When calling it with:</p>
  
  <pre><code>var myClass = new MyClass();
  
  // Classic invocation
  myClass.SayHello(new Dog());
  
  // Reflection
  var method = myClass.GetType().GetMethod("SayHello", new[] { typeof(Dog) });
  method.Invoke(myClass, new object[] { new Dog() });
  
  // dynamic
  ((dynamic)myClass).SayHello((dynamic)new Dog());
  </code></pre>
  
  <p>When calling <code>SayHello</code> is the correct method invoked using the classic method resolution? In other words the output will be always <code>"Hello dog!"</code>?</p>
  
  <p>From a quick test the answer seems to be <strong>yes</strong>, but I cannot find any specific documentation on MSDN.</p>