Given
trait Foo[T <: Bar] {
def foo: T
}
why does the compiler NOT interpret signature like
def foo(f: Foo[_])
to mean that the unknown _
must be a type of Bar
. Instead, it forces me to do this
def foo(f: Foo[_ <: Bar])
which complicates signatures. I'm sure the compiler must be right and I'm missing some subtlety but clearly a Foo[X]
where X
is NOT some kind of Bar
so not possible by construction, so why?
Thank you.