Open Mee-Tree opened 1 year ago
Scala version: 2.13.10
implicitly[{ type T[_[_]] } =:= { type T[_[X] <: Iterable[X]] }]
Somehow the compiler finds an implicit for all of these: <:<, =:=, and >:> (defined like type >:>[+A, -B] = <:<[B, A]).
<:<
=:=
>:>
type >:>[+A, -B] = <:<[B, A]
However, the only correct option is:
implicitly[{ type T[_[_]] } <:< { type T[_[X] <: Iterable[X]] }]
The code works as expected in Scala 3.
Relevant comment in dotty: https://github.com/lampepfl/dotty/blob/3.2.1/compiler/src/dotty/tools/dotc/core/TypeComparer.scala#L686-L709
Reproduction steps
Scala version: 2.13.10
Problem
Somehow the compiler finds an implicit for all of these:
<:<
,=:=
, and>:>
(defined liketype >:>[+A, -B] = <:<[B, A]
).However, the only correct option is:
The code works as expected in Scala 3.