Is there a way to override virtual generic method by replacing some or all of type parameters with actual type arguments?
class A1
{
public virtual void Generic<T, U>(T t, U u) { }
}
class A2 : A1
{
public override void Generic<T,int>(T t, int u) { } //error
}
thanx
Try moving the generic parameters to class.
class A1<T,U>
{
public virtual void Generic(T t, U u) { }
}
class A2<T> : A1<T , int>
{
public override void Generic(T t, int u) { }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With