Understanding type arguments do not conform to class type parameter bounds error when using Higher kinded type parameter
问题 I am trying to understand why the following piece of code won't compile when I use a higher kinded type parameter for T in MyModel abstract class Model[M <: Model[M]] class MyModel[T] extends Model[MyModel[T]] class Bar[TModel <: Model[TModel]] object Foo extends App { new Bar[MyModel[_]] } But if i change it to new Bar[MyModel[Any]] it will compile. Why is this ? 回答1: Bar[MyModel[_]] is Bar[MyModel[X] forSome {type X}] . (It should not be confused neither with Bar[MyModel[X]] forSome {type X