summaryrefslogtreecommitdiff
path: root/test/files/pos/exhaustive_heuristics.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/exhaustive_heuristics.scala')
-rw-r--r--test/files/pos/exhaustive_heuristics.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/exhaustive_heuristics.scala b/test/files/pos/exhaustive_heuristics.scala
new file mode 100644
index 0000000000..f6bea455a5
--- /dev/null
+++ b/test/files/pos/exhaustive_heuristics.scala
@@ -0,0 +1,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
+} \ No newline at end of file