title: C# default interface implementation - can't override
body: <p>I'm following this guide <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/default-interface-methods" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/default-interface-methods</a> to use default interface implementation feature. I've copied a code that defines a default implementation in interface <code>IA</code> and then overrides it in interface <code>IB</code>:</p>
  <pre><code>interface I0
  {
      void M() { Console.WriteLine(&quot;I0&quot;); }
  }
  
  interface I1 : I0
  {
      override void M() { Console.WriteLine(&quot;I1&quot;); }
  }
  </code></pre>
  <p>But it gives be an error <code>CS0106 The modifier 'override' is not valid for this item</code> and a warning <code>CS0108 'I1.M()' hides inherited member 'I0.M()'. Use the new keyword if hiding was intended</code>. <code>TargetFramework</code> is set to <code>net5.0</code>, <code>LangVersion</code> is <code>latest</code>. Why it's not working even if it's described in official docs?</p>