title: name collision of function in two interfaces is accepted
body: <p>This is language agnostic in the sense that my question applies for any language that has the <code>interface</code> concept. (or swift protocols)</p>
  
  <p>Consider this program in C#:</p>
  
  <pre><code>interface Inter1
  {
      int Count();
  }
  
  interface Inter2
  {
      int Count();
  
  }
  
  public class SomeClass : Inter1, Inter2
  {
      public int Count()  // which one is it ?
      {
          return 0;
      }    
  }
  
  static void Main(string[] args)
  {
      Inter1 c = new SomeClass();
      int i = c.Count();
  }
  </code></pre>
  
  <p>Or in C++:
  <a href="https://godbolt.org/z/dFLpji" rel="nofollow noreferrer">https://godbolt.org/z/dFLpji</a></p>
  
  <p><strong>I'm having difficulties making sense of why this is tolerated</strong>, even though it appears that all possible symbol references are unambiguous, since the static type is going to specify which function we are talking about.</p>
  
  <p>But isn't it dangerously close to name hiding ?</p>
  
  <p>illustration of the problem I'm thinking about:</p>
  
  <pre><code>// in FileA.cs on day 0
  interface DatabaseCleaner
  {
      void Execute();
  }
  
  // in FileFarAway.cs day 140
  interface FragmentationLogger
  {
      void Execute();  // unfortunate naming collision not noticed
  }
  
  // in PostGreAgent.cs day 141
  public class PostGreAgent : DatabaseCleaner, FragmentationLogger
  {
      public void Execute()
      {   // I forgot about the method for database cleanup, or dismissed it mentally for later. first let's test this
          allocator.DumpFragmentationInfo();
      }
  
      private Allocator allocator;
  }
  
  // client.cs
  AgentsManager agents;
  void Main(string[] args)
  {
      var pa = new PostGreAgent();
      agents.Add(pa);
      // ... later in a different location
      DatabaseCleaner cleaner = agents.FindBest();
      cleaner.Execute();  // uh oh
  }
  </code></pre>