summaryrefslogtreecommitdiff
path: root/test/files/neg/t8597.check
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-11-21 15:11:48 +0100
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2014-11-21 15:11:48 +0100
commit304edd816329703919808e5ec851ed946e6f549f (patch)
tree7e39c66afda33546ad91fa5500817a731129da5b /test/files/neg/t8597.check
parent495fdb3d72194c8b5010e98a1186ccafc95fbd8a (diff)
parent9266dee17c563c3394077e747c5037050cafcde2 (diff)
downloadscala-304edd816329703919808e5ec851ed946e6f549f.tar.gz
scala-304edd816329703919808e5ec851ed946e6f549f.tar.bz2
scala-304edd816329703919808e5ec851ed946e6f549f.zip
Merge pull request #4115 from retronym/ticket/8597
SI-8597 Improved pattern unchecked warnings
Diffstat (limited to 'test/files/neg/t8597.check')
-rw-r--r--test/files/neg/t8597.check21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/neg/t8597.check b/test/files/neg/t8597.check
new file mode 100644
index 0000000000..bc945f9191
--- /dev/null
+++ b/test/files/neg/t8597.check
@@ -0,0 +1,21 @@
+t8597.scala:2: warning: abstract type T in type pattern Some[T] is unchecked since it is eliminated by erasure
+ def nowarn[T] = (null: Any) match { case _: Some[T] => } // warn (did not warn due to SI-8597)
+ ^
+t8597.scala:5: warning: abstract type pattern T is unchecked since it is eliminated by erasure
+ def warn1[T] = (null: Any) match { case _: T => } // warn
+ ^
+t8597.scala:6: warning: non-variable type argument String in type pattern Some[String] is unchecked since it is eliminated by erasure
+ def warn2 = (null: Any) match { case _: Some[String] => } // warn
+ ^
+t8597.scala:7: warning: non-variable type argument Unchecked.this.C in type pattern Some[Unchecked.this.C] is unchecked since it is eliminated by erasure
+ (null: Any) match { case _: Some[C] => } // warn
+ ^
+t8597.scala:18: warning: abstract type T in type pattern Array[T] is unchecked since it is eliminated by erasure
+ def warnArray[T] = (null: Any) match { case _: Array[T] => } // warn (did not warn due to SI-8597)
+ ^
+t8597.scala:26: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure
+ def warnArrayErasure2 = (null: Any) match {case Some(_: Array[Array[List[String]]]) => } // warn
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+6 warnings found
+one error found