say I have a class:
abstract class A<T> {
public abstract void foo(T a);
}
class B : A<int> {
public void foo(int a) { //ERROR, signature is not correct
}
How do I implement the base class in this case? The type of the parameter should be int.
As others have pointed out, you are missing the override keyword.
However, I want to caution you to be very careful with this pattern. You can get yourself into a world of hurt if you’re not careful:
Which one did it override?
No good whatsoever comes of this situation. The CLR specification recommends that you never get yourself into a situation where two method signatures unify under generic construction. Good advice, that.