scala
scala copied to clipboard
false positive "match may not be exhaustive" warning
scalaVersion := "2.12.2-bin-typelevel-4"
scalaOrganization := "org.typelevel"
object Test {
def foo(a: Stream[Either[Int, String]]): Int = a match {
case Right(_) #:: tail =>
1
case Left(_) #:: tail =>
2
case Stream.Empty =>
3
}
}
Test.scala:2: match may not be exhaustive.
[warn] It would fail on the following input: Cons()
[warn] def foo(a: Stream[Either[Int, String]]): Int = a match {
[warn] ^
[warn] one warning found