summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/applydynamic_sip.check8
-rw-r--r--test/files/neg/t3692-new.check6
-rw-r--r--test/files/neg/t7984.check6
-rw-r--r--test/files/neg/t7984.flags1
-rw-r--r--test/files/neg/t7984.scala7
-rw-r--r--test/files/neg/unchecked-suppress.check4
-rw-r--r--test/files/neg/unchecked.check6
-rw-r--r--test/files/neg/unchecked3.check2
8 files changed, 27 insertions, 13 deletions
diff --git a/test/files/neg/applydynamic_sip.check b/test/files/neg/applydynamic_sip.check
index f28f26c147..2cb2e7f095 100644
--- a/test/files/neg/applydynamic_sip.check
+++ b/test/files/neg/applydynamic_sip.check
@@ -22,21 +22,21 @@ applydynamic_sip.scala:18: error: type mismatch;
error after rewriting to Test.this.bad1.selectDynamic("sel")
possible cause: maybe a wrong Dynamic method signature?
bad1.sel
- ^
+ ^
applydynamic_sip.scala:19: error: type mismatch;
found : String("sel")
required: Int
error after rewriting to Test.this.bad1.applyDynamic("sel")
possible cause: maybe a wrong Dynamic method signature?
bad1.sel(1)
- ^
+ ^
applydynamic_sip.scala:20: error: type mismatch;
found : String("sel")
required: Int
error after rewriting to Test.this.bad1.applyDynamicNamed("sel")
possible cause: maybe a wrong Dynamic method signature?
bad1.sel(a = 1)
- ^
+ ^
applydynamic_sip.scala:20: error: reassignment to val
bad1.sel(a = 1)
^
@@ -46,7 +46,7 @@ applydynamic_sip.scala:21: error: type mismatch;
error after rewriting to Test.this.bad1.updateDynamic("sel")
possible cause: maybe a wrong Dynamic method signature?
bad1.sel = 1
- ^
+ ^
applydynamic_sip.scala:29: error: Int does not take parameters
error after rewriting to Test.this.bad2.selectDynamic("sel")
possible cause: maybe a wrong Dynamic method signature?
diff --git a/test/files/neg/t3692-new.check b/test/files/neg/t3692-new.check
index 9b96449930..bb8692f3ca 100644
--- a/test/files/neg/t3692-new.check
+++ b/test/files/neg/t3692-new.check
@@ -1,10 +1,10 @@
-t3692-new.scala:14: warning: non-variable type argument Int in type pattern Map[Int,Int] is unchecked since it is eliminated by erasure
+t3692-new.scala:14: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[Int,Int] (the underlying of Map[Int,Int]) is unchecked since it is eliminated by erasure
case m0: Map[Int, Int] => new java.util.HashMap[Integer, Integer]
^
-t3692-new.scala:15: warning: non-variable type argument Int in type pattern Map[Int,V] is unchecked since it is eliminated by erasure
+t3692-new.scala:15: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[Int,V] (the underlying of Map[Int,V]) is unchecked since it is eliminated by erasure
case m1: Map[Int, V] => new java.util.HashMap[Integer, V]
^
-t3692-new.scala:16: warning: non-variable type argument Int in type pattern Map[T,Int] is unchecked since it is eliminated by erasure
+t3692-new.scala:16: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[T,Int] (the underlying of Map[T,Int]) is unchecked since it is eliminated by erasure
case m2: Map[T, Int] => new java.util.HashMap[T, Integer]
^
t3692-new.scala:15: warning: unreachable code
diff --git a/test/files/neg/t7984.check b/test/files/neg/t7984.check
new file mode 100644
index 0000000000..0cfd7d1619
--- /dev/null
+++ b/test/files/neg/t7984.check
@@ -0,0 +1,6 @@
+t7984.scala:4: warning: non-variable type argument Int in type pattern List[Int] (the underlying of Test.this.ListInt) is unchecked since it is eliminated by erasure
+ case is: ListInt => is.head
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t7984.flags b/test/files/neg/t7984.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/neg/t7984.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t7984.scala b/test/files/neg/t7984.scala
new file mode 100644
index 0000000000..ca09a89fc7
--- /dev/null
+++ b/test/files/neg/t7984.scala
@@ -0,0 +1,7 @@
+class Test {
+ type ListInt = List[Int]
+ List[Any]("") match {
+ case is: ListInt => is.head
+ case _ =>
+ }
+}
diff --git a/test/files/neg/unchecked-suppress.check b/test/files/neg/unchecked-suppress.check
index 038105918e..d3dc86014b 100644
--- a/test/files/neg/unchecked-suppress.check
+++ b/test/files/neg/unchecked-suppress.check
@@ -1,7 +1,7 @@
-unchecked-suppress.scala:4: warning: non-variable type argument Int in type pattern Set[Int] is unchecked since it is eliminated by erasure
+unchecked-suppress.scala:4: warning: non-variable type argument Int in type pattern scala.collection.immutable.Set[Int] (the underlying of Set[Int]) is unchecked since it is eliminated by erasure
case xs: Set[Int] => xs.head // unchecked
^
-unchecked-suppress.scala:5: warning: non-variable type argument String in type pattern Map[String @unchecked,String] is unchecked since it is eliminated by erasure
+unchecked-suppress.scala:5: warning: non-variable type argument String in type pattern scala.collection.immutable.Map[String @unchecked,String] (the underlying of Map[String @unchecked,String]) is unchecked since it is eliminated by erasure
case xs: Map[String @unchecked, String] => xs.head // one unchecked, one okay
^
unchecked-suppress.scala:7: warning: non-variable type argument Int in type pattern (Int, Int) => Int is unchecked since it is eliminated by erasure
diff --git a/test/files/neg/unchecked.check b/test/files/neg/unchecked.check
index 570f02f219..033cffb18f 100644
--- a/test/files/neg/unchecked.check
+++ b/test/files/neg/unchecked.check
@@ -1,10 +1,10 @@
-unchecked.scala:18: warning: non-variable type argument String in type pattern Iterable[String] is unchecked since it is eliminated by erasure
+unchecked.scala:18: warning: non-variable type argument String in type pattern Iterable[String] (the underlying of Iterable[String]) is unchecked since it is eliminated by erasure
case xs: Iterable[String] => xs.head // unchecked
^
-unchecked.scala:22: warning: non-variable type argument Any in type pattern Set[Any] is unchecked since it is eliminated by erasure
+unchecked.scala:22: warning: non-variable type argument Any in type pattern scala.collection.immutable.Set[Any] (the underlying of Set[Any]) is unchecked since it is eliminated by erasure
case xs: Set[Any] => xs.head // unchecked
^
-unchecked.scala:26: warning: non-variable type argument Any in type pattern Map[Any,Any] is unchecked since it is eliminated by erasure
+unchecked.scala:26: warning: non-variable type argument Any in type pattern scala.collection.immutable.Map[Any,Any] (the underlying of Map[Any,Any]) is unchecked since it is eliminated by erasure
case xs: Map[Any, Any] => xs.head // unchecked
^
unchecked.scala:35: warning: non-variable type argument List[Nothing] in type pattern Test.Contra[List[Nothing]] is unchecked since it is eliminated by erasure
diff --git a/test/files/neg/unchecked3.check b/test/files/neg/unchecked3.check
index a7582a8930..0a526050fc 100644
--- a/test/files/neg/unchecked3.check
+++ b/test/files/neg/unchecked3.check
@@ -31,7 +31,7 @@ unchecked3.scala:62: warning: non-variable type argument Array[String] in type p
unchecked3.scala:63: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure
/* warn */ case _: Array[Array[List[String]]] => ()
^
-unchecked3.scala:75: warning: abstract type A in type pattern Set[Q.this.A] is unchecked since it is eliminated by erasure
+unchecked3.scala:75: warning: abstract type A in type pattern scala.collection.immutable.Set[Q.this.A] (the underlying of Set[Q.this.A]) is unchecked since it is eliminated by erasure
/* warn */ case xs: Set[A] => xs.head
^
unchecked3.scala:62: warning: unreachable code