trait A[T]
type B = A | List // Error: Type argument A does not have the same kind as its bound
def foo[C <: A, T]: C[T] = ??? // Error: type A takes type parameters
summon[A <:< A] // Error: Type argument A does not have the same kind as its bound
Expectation
Understandable error messages, similarly to:
trait A[T]
// Error: the scrutinee of a match type cannot be higher-kinded
type Foo[B <: A] = B match
case _ => Nothing
These error messages are particularly confusing given the currently incorrect documentation about wildcard arguments.
Improved error message examples:
trait A[T]
type B = A | List // Error: components of a union type cannot be higher-kinded
def foo[C <: A, T]: C[T] = ??? // Error: a higher-kinded type on the rhs of <: needs to be eta-expanded
// (but eta-expanding the lhs is not legal!)
summon[A <:< A] // Error: the arguments to <:< cannot be higher-kinded
Compiler version
3.4.0-RC1
Minimized code
Expectation
Understandable error messages, similarly to:
These error messages are particularly confusing given the currently incorrect documentation about wildcard arguments.
Improved error message examples: