title: GetRuntimeInterfaceMap Returns Unexpected Mapped Method
body: <p>I am running into a problem with <a href="https://msdn.microsoft.com/en-us/library/system.reflection.runtimereflectionextensions.getruntimeinterfacemap(v=vs.110).aspx" rel="nofollow"><code>GetRuntimeInterfaceMap</code></a> (<a href="https://msdn.microsoft.com/en-us/library/system.type.getinterfacemap(v=vs.110).aspx" rel="nofollow"><code>GetInterfaceMap</code></a> also exhibits the same behavior) and I am hoping to have someone shed some light on what I am doing wrong, and how I can possibly address it.  Here is a simple xUnit test along with corresponding code that demonstrates the issue:</p>
  
  <p>(I also <a href="https://github.com/Mike-EEE/Stash/tree/master/Reflection.InterfaceMaps" rel="nofollow">have it hosted on GitHub</a> if you would like to run it locally in VS2015+).</p>
  
  <pre><code>using System;
  using System.Linq;
  using System.Reflection;
  using System.Windows.Input;
  using Xunit;
  
  namespace Reflection.InterfaceMaps
  {
      public class BasicTests
      {
          [Fact]
          public void VerifyMappings()
          {
              var expected = typeof(Expected).GetTypeInfo().GetRuntimeInterfaceMap( typeof(ICommand) );
              Assert.Equal( "System.Windows.Input.ICommand.Execute", expected.TargetMethods.Last().Name );
  
              var unexpected = typeof(Unexpected).GetTypeInfo().GetRuntimeInterfaceMap( typeof(ICommand) );
              Assert.Equal( "System.Windows.Input.ICommand.Execute", unexpected.TargetMethods.Last().Name ); // Fails with "Execute"
          }
      }
  
      interface ICommand&lt;in T&gt; : ICommand
      {
          void Execute( T parameter );
      }
  
      abstract class CommandBase&lt;T&gt; : ICommand&lt;T&gt;
      {
          bool ICommand.CanExecute( object parameter ) =&gt; false;
          void ICommand.Execute( object parameter ) {}
          public event EventHandler CanExecuteChanged;
  
          public abstract void Execute( T parameter );
      }
  
      class Expected : CommandBase&lt;object&gt;
      {
          public override void Execute( object parameter ) {}
      }
  
      interface IUnexpected : ICommand&lt;object&gt; {}
      class Unexpected : CommandBase&lt;object&gt;, IUnexpected
      {
          public override void Execute( object parameter ) {}
      }
  </code></pre>
  
  <p>As you can see, the <code>Expected</code> type returns the expected mapping to the desired explicitly defined method of <code>System.Windows.Input.ICommand.Execute</code>. However, the <code>Unexpected</code> type does not.  <code>Unexpected</code> also implements <code>IUnexpected</code> which implements <code>ICommand&lt;&gt;</code> which in turn implements <code>ICommand</code>, the ultimate interface I am interested in.</p>
  
  <p>I would expect that the requested interface mapping for <code>ICommand</code> would return the explicit method mapped as found in the expected map, but alas it does not.</p>
  
  <p>Is there another consideration here that I should explore?  Or is this perhaps a bug? (Never know :) ).</p>