Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

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

Open
xuwei-k opened this issue May 13, 2017 · 0 comments
Open

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

xuwei-k opened this issue May 13, 2017 · 0 comments

Comments

@xuwei-k
Copy link

xuwei-k commented May 13, 2017

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant