summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-06-24 15:19:05 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-06-24 18:10:42 +1000
commit1f7417c763fb199cacc6afedc6e54796916fd673 (patch)
treebd00d7e0e47be310172f01c758c01ca5430063c4 /test/files/neg
parent73f40564a6b19e8b15f0908c3e24f1a8fe405605 (diff)
parent1b09e12ef3b3fea1cab56bac893295f74de23b8b (diff)
downloadscala-1f7417c763fb199cacc6afedc6e54796916fd673.tar.gz
scala-1f7417c763fb199cacc6afedc6e54796916fd673.tar.bz2
scala-1f7417c763fb199cacc6afedc6e54796916fd673.zip
Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/inlineMaxSize.check4
-rw-r--r--test/files/neg/inlineMaxSize.scala2
-rw-r--r--test/files/neg/names-defaults-neg.check4
-rw-r--r--test/files/neg/names-defaults-neg.scala4
-rw-r--r--test/files/neg/t2866.check2
-rw-r--r--test/files/neg/t2866.scala2
-rw-r--r--test/files/neg/t3234.flags2
-rw-r--r--test/files/neg/t3995.scala2
-rw-r--r--test/files/neg/t7623.check24
-rw-r--r--test/files/neg/t7623.scala8
-rw-r--r--test/files/neg/t8237-default.scala2
-rw-r--r--test/files/neg/t8431.scala2
-rw-r--r--test/files/neg/t8463.scala2
-rw-r--r--test/files/neg/t9286a.check7
-rw-r--r--test/files/neg/t9286a.scala13
-rw-r--r--test/files/neg/t9286b.check7
-rw-r--r--test/files/neg/t9286b.scala5
-rw-r--r--test/files/neg/t9286c.check7
-rw-r--r--test/files/neg/t9286c.scala14
19 files changed, 80 insertions, 33 deletions
diff --git a/test/files/neg/inlineMaxSize.check b/test/files/neg/inlineMaxSize.check
index d218a8b6e2..9d790e154c 100644
--- a/test/files/neg/inlineMaxSize.check
+++ b/test/files/neg/inlineMaxSize.check
@@ -2,8 +2,8 @@ inlineMaxSize.scala:7: warning: C::i()I is annotated @inline but could not be in
The size of the callsite method C::j()I
would exceed the JVM method size limit after inlining C::i()I.
- @inline final def j = i + i
- ^
+ @inline final def j = i + i + i
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
one warning found
one error found
diff --git a/test/files/neg/inlineMaxSize.scala b/test/files/neg/inlineMaxSize.scala
index 16dc0d9538..9d2db1a357 100644
--- a/test/files/neg/inlineMaxSize.scala
+++ b/test/files/neg/inlineMaxSize.scala
@@ -4,5 +4,5 @@ class C {
@inline final def g = f + f + f + f + f + f + f + f + f + f
@inline final def h = g + g + g + g + g + g + g + g + g + g
@inline final def i = h + h + h + h + h + h + h + h + h + h
- @inline final def j = i + i
+ @inline final def j = i + i + i
}
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index 194be72250..8a6aafd67a 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -64,7 +64,7 @@ names-defaults-neg.scala:49: error: ambiguous reference to overloaded definition
both method g in object t7 of type (a: B)String
and method g in object t7 of type (a: C, b: Int*)String
match argument types (C)
- t7.g(new C()) // ambigous reference
+ t7.g(new C()) // ambiguous reference
^
names-defaults-neg.scala:53: error: parameter 'b' is already specified at parameter position 2
test5(a = 1, b = "dkjl", b = "dkj")
@@ -79,7 +79,7 @@ names-defaults-neg.scala:61: error: ambiguous reference to overloaded definition
both method f in object t8 of type (b: String, a: Int)String
and method f in object t8 of type (a: Int, b: Object)String
match argument types (a: Int,b: String) and expected result type Any
- println(t8.f(a = 0, b = "1")) // ambigous reference
+ println(t8.f(a = 0, b = "1")) // ambiguous reference
^
names-defaults-neg.scala:69: error: wrong number of arguments for pattern A1(x: Int,y: String)
A1() match { case A1(_) => () }
diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala
index c809b9a7a2..b326d3b5bd 100644
--- a/test/files/neg/names-defaults-neg.scala
+++ b/test/files/neg/names-defaults-neg.scala
@@ -46,7 +46,7 @@ object Test extends App {
def g(a: C, b: Int*) = "third"
def g(a: B) = "fourth"
}
- t7.g(new C()) // ambigous reference
+ t7.g(new C()) // ambiguous reference
// vararg
def test5(a: Int, b: String*) = a
@@ -58,7 +58,7 @@ object Test extends App {
def f(a: Int, b: Object) = "first"
def f(b: String, a: Int) = "second"
}
- println(t8.f(a = 0, b = "1")) // ambigous reference
+ println(t8.f(a = 0, b = "1")) // ambiguous reference
// case class copy does not exist if there's a vararg
diff --git a/test/files/neg/t2866.check b/test/files/neg/t2866.check
index 340fb8da22..bc0da7e355 100644
--- a/test/files/neg/t2866.check
+++ b/test/files/neg/t2866.check
@@ -5,7 +5,7 @@ t2866.scala:42: error: ambiguous implicit values:
both value two of type Int
and value one in object A of type => Int
match expected type Int
- assert(implicitly[Int] == 2) // !!! Not ambiguous in 2.8.0. Ambigous in 2.7.6
+ assert(implicitly[Int] == 2) // !!! Not ambiguous in 2.8.0. Ambiguous in 2.7.6
^
t2866.scala:50: error: ambiguous implicit values:
both value two of type Int
diff --git a/test/files/neg/t2866.scala b/test/files/neg/t2866.scala
index 55ebff9710..6be8bf9e89 100644
--- a/test/files/neg/t2866.scala
+++ b/test/files/neg/t2866.scala
@@ -39,7 +39,7 @@ object Test {
import A.one
assert(implicitly[Int] == 1)
implicit val two = 2
- assert(implicitly[Int] == 2) // !!! Not ambiguous in 2.8.0. Ambigous in 2.7.6
+ assert(implicitly[Int] == 2) // !!! Not ambiguous in 2.8.0. Ambiguous in 2.7.6
}
locally {
diff --git a/test/files/neg/t3234.flags b/test/files/neg/t3234.flags
index cc3d9fb6f0..406231bd96 100644
--- a/test/files/neg/t3234.flags
+++ b/test/files/neg/t3234.flags
@@ -1 +1 @@
--Yinline -Yinline-warnings -Xfatal-warnings
+-Yinline -Yinline-warnings -Xfatal-warnings -Ybackend:GenASM
diff --git a/test/files/neg/t3995.scala b/test/files/neg/t3995.scala
index b03617ac86..c79f2a5865 100644
--- a/test/files/neg/t3995.scala
+++ b/test/files/neg/t3995.scala
@@ -27,6 +27,6 @@ object Test {
// can be accessed with unambiguous stable prefixes, the implicits infos
// which are members of these companion objects."
//
- // The skolem is stable, but it doen't seem much good to us
+ // The skolem is stable, but it does not seem much good to us
(new Lift).apply("")
}
diff --git a/test/files/neg/t7623.check b/test/files/neg/t7623.check
index db368dd369..de35023664 100644
--- a/test/files/neg/t7623.check
+++ b/test/files/neg/t7623.check
@@ -1,21 +1,15 @@
-t7623.scala:19: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*).
- def f = "" match { case X(s) => }
+t7623.scala:21: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime.
+ def g = "" match { case X(s, t) => } // warn
^
-t7623.scala:21: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*).
- def g = "" match { case X(s, t) => }
+t7623.scala:23: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected.
+ def h = "" match { case X(s, t, u @ _*) => } // warn
^
-t7623.scala:23: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*).
- def h = "" match { case X(s, t, u @ _*) => }
- ^
-t7623.scala:9: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*).
- def f = C("") match { case C(s) => }
- ^
-t7623.scala:11: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*).
- def g = C("") match { case C(s, t) => }
+t7623.scala:11: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime.
+ def g = C("") match { case C(s, t) => } // warn
^
-t7623.scala:13: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*).
- def h = C("") match { case C(s, t, u @ _*) => }
+t7623.scala:13: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected.
+ def h = C("") match { case C(s, t, u @ _*) => } // warn
^
error: No warnings can be incurred under -Xfatal-warnings.
-6 warnings found
+four warnings found
one error found
diff --git a/test/files/neg/t7623.scala b/test/files/neg/t7623.scala
index 5c40f37bc1..5334cc5f69 100644
--- a/test/files/neg/t7623.scala
+++ b/test/files/neg/t7623.scala
@@ -8,9 +8,9 @@ object X { def unapplySeq(a: Any): Option[(String, Seq[Int])] = Some("", List(1,
trait Ctest {
def f = C("") match { case C(s) => }
- def g = C("") match { case C(s, t) => }
+ def g = C("") match { case C(s, t) => } // warn
- def h = C("") match { case C(s, t, u @ _*) => }
+ def h = C("") match { case C(s, t, u @ _*) => } // warn
def ok = C("") match { case C(s, u @ _*) => }
}
@@ -18,9 +18,9 @@ trait Ctest {
trait Xtest {
def f = "" match { case X(s) => }
- def g = "" match { case X(s, t) => }
+ def g = "" match { case X(s, t) => } // warn
- def h = "" match { case X(s, t, u @ _*) => }
+ def h = "" match { case X(s, t, u @ _*) => } // warn
def ok = "" match { case X(s, u @ _*) => }
}
diff --git a/test/files/neg/t8237-default.scala b/test/files/neg/t8237-default.scala
index f695aa523f..a4370046bd 100644
--- a/test/files/neg/t8237-default.scala
+++ b/test/files/neg/t8237-default.scala
@@ -1,4 +1,4 @@
-// This test case was extracte from `names-defaults-neg.scala`
+// This test case was extracted from `names-defaults-neg.scala`
// It pinpoints an improvement an error message that results from
// a type inference failure
object Test extends App {
diff --git a/test/files/neg/t8431.scala b/test/files/neg/t8431.scala
index 032a1f394d..bc45bb62ae 100644
--- a/test/files/neg/t8431.scala
+++ b/test/files/neg/t8431.scala
@@ -48,7 +48,7 @@ class TestExplicit {
{val c1 = convert2(s); c1.combined}
}
-// These ones work before and after; infering G=Null doesn't need to contribute an undetermined type param.
+// These ones work before and after; inferring G=Null doesn't need to contribute an undetermined type param.
class Test3 {
import C.{cbf, convert1, convert2}
val s: Invariant[Null] = ???
diff --git a/test/files/neg/t8463.scala b/test/files/neg/t8463.scala
index 7c954fd834..1337f8bece 100644
--- a/test/files/neg/t8463.scala
+++ b/test/files/neg/t8463.scala
@@ -7,7 +7,7 @@ object Test {
/* If SI-8230 is fixed, and `viewExists` is changed to no longer leak
ambiguity errors, you might expect the check file for this test to
- change as folloes:
+ change as follows:
@@ -1,18 +1,10 @@
-t8463.scala:5: error: no type parameters for method apply: (activity:
diff --git a/test/files/neg/t9286a.check b/test/files/neg/t9286a.check
new file mode 100644
index 0000000000..2bc7c0cf15
--- /dev/null
+++ b/test/files/neg/t9286a.check
@@ -0,0 +1,7 @@
+t9286a.scala:6: error: name clash between defined and inherited member:
+def foo(o: (String,)): Unit in class T and
+private def foo(o: (Any,)): Unit at line 6
+have same type after erasure: (o: Tuple1)Unit
+ private def foo(o: Tuple1[Any]) = ()
+ ^
+one error found
diff --git a/test/files/neg/t9286a.scala b/test/files/neg/t9286a.scala
new file mode 100644
index 0000000000..0375ac591f
--- /dev/null
+++ b/test/files/neg/t9286a.scala
@@ -0,0 +1,13 @@
+class T {
+ def foo(o: Tuple1[String]) = ()
+}
+
+class U extends T {
+ private def foo(o: Tuple1[Any]) = ()
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new U().foo(null) // IllegalAccessError: tried to access method U.foo(Lscala/Tuple1;)V from class Test$
+ }
+}
diff --git a/test/files/neg/t9286b.check b/test/files/neg/t9286b.check
new file mode 100644
index 0000000000..89a191bfee
--- /dev/null
+++ b/test/files/neg/t9286b.check
@@ -0,0 +1,7 @@
+t9286b.scala:2: error: name clash between defined and inherited member:
+def foo: Int in class C and
+private def foo[A]: Int at line 2
+have same type after erasure: ()Int
+class D extends C { private def foo[A] = 0 }
+ ^
+one error found
diff --git a/test/files/neg/t9286b.scala b/test/files/neg/t9286b.scala
new file mode 100644
index 0000000000..5c23075426
--- /dev/null
+++ b/test/files/neg/t9286b.scala
@@ -0,0 +1,5 @@
+class C { def foo = 0 }
+class D extends C { private def foo[A] = 0 }
+
+class E { private def foo = 0 }
+class F extends E { def foo[A] = 0 } // okay
diff --git a/test/files/neg/t9286c.check b/test/files/neg/t9286c.check
new file mode 100644
index 0000000000..785cb3f937
--- /dev/null
+++ b/test/files/neg/t9286c.check
@@ -0,0 +1,7 @@
+t9286c.scala:8: error: name clash between defined and inherited member:
+def foo(m: M[_ >: String]): Int in trait T and
+private def foo(m: M[_ >: Any]): Int at line 8
+have same type after erasure: (m: M)Int
+ def foo(m: M[_ >: Any]) = 0 // Expected: "same type after erasure"
+ ^
+one error found
diff --git a/test/files/neg/t9286c.scala b/test/files/neg/t9286c.scala
new file mode 100644
index 0000000000..3df08dcfe6
--- /dev/null
+++ b/test/files/neg/t9286c.scala
@@ -0,0 +1,14 @@
+class M[_]
+trait T {
+ def foo(m: M[_ >: String]) = 42
+}
+
+object Test {
+ def t: T = new T {
+ def foo(m: M[_ >: Any]) = 0 // Expected: "same type after erasure"
+ }
+ def main(args: Array[String]): Unit = {
+ val m: M[String] = null
+ t.foo(m) // VeriyError: Duplicate method name&signature
+ }
+}