I try to override this method
def sum[B >: A](implicit num: Numeric[B]): B = ...
in a subclass where type A
is already fixed to Int
.
I already tried
override def sum: Int = ...
but this doesn't override of course, leading to different method resolution based on the dynamic type at runtime.
Going further,
def sum[B >: Int](implicit num: Numeric[B]): Int
does override, while
def sum[B >: Int](implicit num: Numeric[Int]): Int
does not, as well as
def sum(implicit num: Numeric[Int]): Int
Why is that the case? Is it at leats possible to get rid of the superfluous bound B
?
I'm not sure which types and implicits I can leave out and what has to stay so that the method still overrides.