Open
Description
Compiler version
3.3.1
3.4.0-RC4
Minimized code
// Error: Cannot prove that A[U] <:< A[N].
Wrap(new A[N]{})
// Adding the obvious type argument to Wrap makes it compile just fine.
Wrap[N](new A[N]{})
final case class Wrap[T <: U](first: A[T])(using A[T] <:< A[N])
sealed trait A[+T]
type U = Any
type N = Nothing
Compiler output
Cannot prove that A[U] <:< A[N].
Expectation
No error, similarly to when U
is inlined, or N
is not set to Nothing
.