typelevel / scala

Typelevel Scala, a fork of Scala
http://typelevel.org/scala/
372 stars 21 forks source link

false positive "match may not be exhaustive" warning #148

Open xuwei-k opened 7 years ago

xuwei-k commented 7 years ago
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