Skip to content

Match exhaustion warning on literal type #11603

@dwijnand

Description

@dwijnand
class C {
  def m(x: true) = x match {
    case true => println("the one true path")
  }
}
14:53:27 $ scala exhaustive-literals.scala
exhaustive-literals.scala:2: warning: match may not be exhaustive.
It would fail on the following input: false
  def m(x: true) = x match {
                   ^

Scala 2.13.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions