summaryrefslogtreecommitdiff
path: root/test/files/pos/exhaustive_heuristics.scala
blob: f6bea455a57d08c6a745dd53ef8c681f981a7e86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// tests exhaustivity doesn't give warnings (due to its heuristic rewrites kicking in or it backing off)
object Test {
  // List() => Nil
  List(1) match {
    case List() =>
    case x :: xs =>
  }

  // we don't look into guards
  val turnOffChecks = true
  List(1) match {
    case _ if turnOffChecks =>
  }

  // TODO: we back off when there are any user-defined extractors
}