summaryrefslogtreecommitdiff
path: root/test/files/neg/t7020.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-10-21 22:50:58 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-10-22 10:15:59 +0200
commit69557da5539a5a5132100fdab931e69f82139e15 (patch)
treebab832e1c91ce93abc6067779e6fd90c1d3cf940 /test/files/neg/t7020.check
parent90d6605d88ee01cb7e1e8761cc82ba28c8575d27 (diff)
downloadscala-69557da5539a5a5132100fdab931e69f82139e15.tar.gz
scala-69557da5539a5a5132100fdab931e69f82139e15.tar.bz2
scala-69557da5539a5a5132100fdab931e69f82139e15.zip
SI-7020 Deterministic warnings for pattern matcher, take 2
The previous swing at determinism, ebb01e05cbe4, made decent contact but apparently didn't hit it out of the park. The test wavered every hundred or so runs, as witnessed occasionally in nightly builds or pull request validation. I setup a test to run neg/7020.scala a few hundred times, and could trigger the failure reliably. I then swept through the pattern matcher in search of HashMap and HashSet creation, and changed them all to the Linked variety. The results of that are published in retronym#ticket/7020-3 [1]. This commit represents the careful whittling down of that patch to the minimal change required to exhibit determinism. [1] https://github.com/retronym/scala/compare/ticket/7020-3
Diffstat (limited to 'test/files/neg/t7020.check')
-rw-r--r--test/files/neg/t7020.check19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/t7020.check b/test/files/neg/t7020.check
new file mode 100644
index 0000000000..76390b243d
--- /dev/null
+++ b/test/files/neg/t7020.check
@@ -0,0 +1,19 @@
+t7020.scala:3: warning: match may not be exhaustive.
+It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _)
+ List(5) match {
+ ^
+t7020.scala:10: warning: match may not be exhaustive.
+It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _)
+ List(5) match {
+ ^
+t7020.scala:17: warning: match may not be exhaustive.
+It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _)
+ List(5) match {
+ ^
+t7020.scala:24: warning: match may not be exhaustive.
+It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _)
+ List(5) match {
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+four warnings found
+one error found