title: C# abstract record with abstract Equals method
body: <p>Why are we not allowed to do the following for a record</p>
  <pre><code>abstract record AA
  {
    public abstract bool Equals(AA other);
  }
  
  record BB:AA
  {
    public override bool Equals(AA other)// error as it is already implemented
    {
      //do some thing
    }
  }
  </code></pre>
  <p>while it is totally acceptable for classes?</p>
  <pre><code>abstract class AA
  {
     public abstract bool Equals(AA other);
  }
  
  class BB:AA
  {
    public override bool Equals(AA other)
    {
      //do some thing
    }
  }
  </code></pre>
  <p>By the way, I am doing this implementation to enforce the Equals check to cascade to its derived classes.</p>
  <p><strong>Edit:</strong> just to give context on why am I interested on this is because I am currently creating an <a href="https://github.com/marlond18/EMDD.KtEquatable" rel="nofollow noreferrer">library/autogenerator</a> for IEquatable.</p>
  <p><strong>Edit/Info 2:</strong> Based on the comments, I have done some tests. since the abstract Equals method of record can't be overridden, I tried leaving it as is.</p>
  <pre><code>public abstract record AA
  {
      public int Prop1 { get; set; }
      public string? Prop2 { get; set; }
      public string? Prop5 { get; set; }
      public abstract bool Equals(AA? other);
  }
  
  public record BB : AA
  {
      public string? Prop3 { get; set; }
  }
  </code></pre>
  <p>The result I get an error of <em><strong>System.BadImageFormatException: Bad IL format.</strong></em></p>
  <p>All in all, abstract Equals method on records is not just an unnecessary implementation but is also a bad one.</p>