-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Minimized code
//> using scala 3.7.4
//> using option -language:strictEquality
sealed trait Op derives CanEqual
case object OpA extends Op
object Test1:
val op: Op => Int =
case OpA => 42
sealed trait OpX[X] derives CanEqual
case object OpXA extends OpX[Int]
object Test2:
def op[A]: OpX[A] => Int =
case OpXA => 42 // ❌Output
[error] ./what.scala:16:10
[error] Values of types object OpXA and OpX[A] cannot be compared with == or !=.
[error] I found:
[error]
[error] OpX.derived$CanEqual[Int, A](/* missing */summon[CanEqual[Int, A]])
[error]
[error] But no implicit values were found that match type CanEqual[Int, A]
[error]
[error] where: A is a type in method op which is an alias of Int
[error] .
[error] case OpXA => 42 // ❌
[error] ^^^^
Expectation
Successful compilation.
Reactions are currently unavailable