I'm tring to do :
public abstract class Base
public abstract Task Execute();
public abstract class Concrete<T> : Base where T : class
new public abstract Task<T> Execute();
CS0533 'Concrete.Execute()' hides inherited abstract member 'Program.Base.Execute()
The problem is that the base method is
abstract. A class inheriting from
Concrete<T> would have to override
Base.Execute(), but it could not override it, because it is hidden by
Concrete<T> would be an
abstract class that can't possibly have any implementation (at least not in C#), at thus it would be useless. So, the C# compiler does not let you write it.
Base was an interface, you could work around this by using an explicit interface implementation. But there is nothing like explicit base class implementation, so I don't think there is any way to have this kind of code, at least not without renaming one of the two methods.