Closed
Description
Compiler version
3.5.1-RC2
Minimized code
import scala.collection.LinearSeq
def foo[T](a: LinearSeq[T]) = a match
case Nil => -1
case head +: tail => head
Compiler options
-language:strictEquality
-Yexplicit-nulls
Compiler output
Values of types object Nil and LinearSeq[T] cannot be compared with == or !=.
Expectation
No compile-error
Note: the addition of CanEqual
givens between Nil.type
and LinearSeq
does not help.