unoplatform / Uno.CodeGen

A set of source generators for equality, immutability, ...
Other
90 stars 11 forks source link

Derived version of a Key Equatable class should also be Key Equatable #118

Open carldebilly opened 5 years ago

carldebilly commented 5 years ago

Bug report

Derived class for a IKeyEquatable class should be IKeyEquatable also using the same key (if none defined on derived class)

[GeneratedImmutable]
public partial class A
{
  [EqualityKey]
  public string Id { get; }

  public string Name { get; }
}

[GeneratedImmutable]
public partial class B : A
{
  public string Description { get; }
}

// A will be IKeyEquatable<A>
// B should also be IKeyEquatable<B> --AND-- IKeyEquatable<A>

Expected behavior

In previous example, B should be both IKeyEquatable<A> and IKeyEquatable<B>.