Is there a way to build an interface like IEnumerable and IEnumerable<T>
public interface IFoo {
object Bar { get; }
}
public interface IFoo<T> : IFoo {
T Bar { get; }
}
public class Test : IFoo<int> {
public new int Bar => 1;
}
this throw an error:
Error: (9.21): Error CS0738: 'Test' does not implement interface member 'IFoo.Bar'. 'Test.Bar' cannot implement 'IFoo.Bar' because it does not have the matching return type of 'object'.