summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-24 02:08:40 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-24 02:08:40 -0700
commit84c0aa63d13008bdb0a9ab43064c3281a6f6b006 (patch)
tree27cbe1fca6a8068a41671abc0c9ebfaf6f988e36 /test
parent54b5bea7a498be3520b12aa9107d64ab946e67a8 (diff)
parent100d82697b2ec747cfc955a9869b8c3d2900f1a2 (diff)
downloadscala-84c0aa63d13008bdb0a9ab43064c3281a6f6b006.tar.gz
scala-84c0aa63d13008bdb0a9ab43064c3281a6f6b006.tar.bz2
scala-84c0aa63d13008bdb0a9ab43064c3281a6f6b006.zip
Merge pull request #974 from adriaanm/repull-unchecked-hk
Improve unchecked warnings.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/unchecked2.check19
-rw-r--r--test/files/neg/unchecked2.flags1
-rw-r--r--test/files/neg/unchecked2.scala8
-rw-r--r--test/files/pos/t1439.scala2
4 files changed, 29 insertions, 1 deletions
diff --git a/test/files/neg/unchecked2.check b/test/files/neg/unchecked2.check
new file mode 100644
index 0000000000..2c0be9ce00
--- /dev/null
+++ b/test/files/neg/unchecked2.check
@@ -0,0 +1,19 @@
+unchecked2.scala:2: error: non variable type-argument Int in type Option[Int] is unchecked since it is eliminated by erasure
+ Some(123).isInstanceOf[Option[Int]]
+ ^
+unchecked2.scala:3: error: non variable type-argument String in type Option[String] is unchecked since it is eliminated by erasure
+ Some(123).isInstanceOf[Option[String]]
+ ^
+unchecked2.scala:4: error: non variable type-argument List[String] in type Option[List[String]] is unchecked since it is eliminated by erasure
+ Some(123).isInstanceOf[Option[List[String]]]
+ ^
+unchecked2.scala:5: error: non variable type-argument List[Int => String] in type Option[List[Int => String]] is unchecked since it is eliminated by erasure
+ Some(123).isInstanceOf[Option[List[Int => String]]]
+ ^
+unchecked2.scala:6: error: non variable type-argument (String, Double) in type Option[(String, Double)] is unchecked since it is eliminated by erasure
+ Some(123).isInstanceOf[Option[(String, Double)]]
+ ^
+unchecked2.scala:7: error: non variable type-argument String => Double in type Option[String => Double] is unchecked since it is eliminated by erasure
+ Some(123).isInstanceOf[Option[String => Double]]
+ ^
+6 errors found
diff --git a/test/files/neg/unchecked2.flags b/test/files/neg/unchecked2.flags
new file mode 100644
index 0000000000..144ddac9d3
--- /dev/null
+++ b/test/files/neg/unchecked2.flags
@@ -0,0 +1 @@
+-unchecked -Xfatal-warnings
diff --git a/test/files/neg/unchecked2.scala b/test/files/neg/unchecked2.scala
new file mode 100644
index 0000000000..a2e757e1dc
--- /dev/null
+++ b/test/files/neg/unchecked2.scala
@@ -0,0 +1,8 @@
+object Test {
+ Some(123).isInstanceOf[Option[Int]]
+ Some(123).isInstanceOf[Option[String]]
+ Some(123).isInstanceOf[Option[List[String]]]
+ Some(123).isInstanceOf[Option[List[Int => String]]]
+ Some(123).isInstanceOf[Option[(String, Double)]]
+ Some(123).isInstanceOf[Option[String => Double]]
+}
diff --git a/test/files/pos/t1439.scala b/test/files/pos/t1439.scala
index 68a7332b2a..0efcc74b65 100644
--- a/test/files/pos/t1439.scala
+++ b/test/files/pos/t1439.scala
@@ -2,7 +2,7 @@
class View[C[A]] { }
object Test {
- null match {
+ (null: Any) match {
case v: View[_] =>
}
}