Closed marcopiii closed 1 month ago
This has already been fixed in Next (3.4.0 and onwards), as well as backported to 3.3.4-RC1. For the LTS line, either test with the RC or wait for 3.3.4 to be out.
//> using options -language:strictEquality -Wunused:all -Xfatal-warnings -source:future
//> using scala 3.3.4-RC1 3.4.0 3.4.1 3.4.2 3.5.0
@main def main(): Unit = {
type DorS = Double | String
val a: DorS = 1.0
val b: DorS = "hello"
given CanEqual[DorS, DorS] = CanEqual.derived
println(a == b)
}
Closing this, nothing to be done.
Compiler version
Minimized code
Output
but if I remove it the compiler rightfully states that
Expectation
I expect no warning since the given is used and needed