summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/checksensible.check17
-rw-r--r--test/files/neg/forgot-interpolator.check21
-rw-r--r--test/files/neg/forgot-interpolator.scala24
-rw-r--r--test/files/neg/newpat_unreachable.check8
-rw-r--r--test/files/neg/package-ob-case.check5
-rw-r--r--test/files/neg/pat_unreachable.check5
-rw-r--r--test/files/neg/t2462b.check5
-rw-r--r--test/files/neg/t2462b.flags1
-rw-r--r--test/files/neg/t2462b.scala3
-rw-r--r--test/files/neg/t2462c.check7
-rw-r--r--test/files/neg/t2462c.flags1
-rw-r--r--test/files/neg/t2462c.scala25
-rw-r--r--test/files/neg/t3971.check21
-rw-r--r--test/files/neg/t3971.scala12
-rw-r--r--test/files/neg/t5426.check8
-rw-r--r--test/files/neg/t5663-badwarneq.check5
-rw-r--r--test/files/neg/t6048.check5
-rw-r--r--test/files/neg/t6120.check20
-rw-r--r--test/files/neg/t6120.flags1
-rw-r--r--test/files/neg/t6120.scala7
-rw-r--r--test/files/neg/t7721.check8
-rw-r--r--test/files/neg/t7756b.check5
-rw-r--r--test/files/neg/t7848-interp-warn.check9
-rw-r--r--test/files/neg/t7848-interp-warn.scala5
-rw-r--r--test/files/neg/t7870.check4
-rw-r--r--test/files/neg/t7870.scala3
-rw-r--r--test/files/neg/t7877.check7
-rw-r--r--test/files/neg/t7877.scala13
-rw-r--r--test/files/neg/unreachablechar.check5
-rw-r--r--test/files/neg/warn-unused-privates.check5
30 files changed, 226 insertions, 39 deletions
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check
index e5f1a38d96..ef3aee5ee4 100644
--- a/test/files/neg/checksensible.check
+++ b/test/files/neg/checksensible.check
@@ -28,6 +28,9 @@ checksensible.scala:27: warning: comparing values of types Int and Unit using `=
checksensible.scala:29: warning: comparing values of types Int and String using `==' will always yield false
1 == "abc"
^
+checksensible.scala:29: warning: Int and String are unrelated: they will most likely never compare equal
+ 1 == "abc"
+ ^
checksensible.scala:33: warning: comparing values of types Some[Int] and Int using `==' will always yield false
Some(1) == 1 // as above
^
@@ -61,12 +64,18 @@ checksensible.scala:51: warning: comparing values of types Int and Unit using `!
checksensible.scala:52: warning: comparing values of types Int and Symbol using `!=' will always yield true
(1 != 'sym)
^
+checksensible.scala:52: warning: Int and Symbol are unrelated: they will most likely always compare unequal
+ (1 != 'sym)
+ ^
checksensible.scala:58: warning: comparing a fresh object using `==' will always yield false
((x: Int) => x + 1) == null
^
checksensible.scala:59: warning: comparing a fresh object using `==' will always yield false
Bep == ((_: Int) + 1)
^
+checksensible.scala:59: warning: Bep.type and Int => Int are unrelated: they will most likely never compare equal
+ Bep == ((_: Int) + 1)
+ ^
checksensible.scala:61: warning: comparing a fresh object using `==' will always yield false
new Object == new Object
^
@@ -82,6 +91,9 @@ checksensible.scala:66: warning: comparing values of types Int and Null using `=
checksensible.scala:71: warning: comparing values of types Bip and Bop using `==' will always yield false
(x1 == x2)
^
+checksensible.scala:71: warning: Bip and Bop are unrelated: they will most likely never compare equal
+ (x1 == x2)
+ ^
checksensible.scala:81: warning: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false
c3 == z1
^
@@ -94,9 +106,12 @@ checksensible.scala:83: warning: comparing values of types EqEqRefTest.this.Z1 a
checksensible.scala:84: warning: comparing values of types EqEqRefTest.this.C3 and String using `!=' will always yield true
c3 != "abc"
^
+checksensible.scala:84: warning: EqEqRefTest.this.C3 and String are unrelated: they will most likely always compare unequal
+ c3 != "abc"
+ ^
checksensible.scala:95: warning: comparing values of types Unit and Int using `!=' will always yield true
while ((c = in.read) != -1)
^
error: No warnings can be incurred under -Xfatal-warnings.
-33 warnings found
+38 warnings found
one error found
diff --git a/test/files/neg/forgot-interpolator.check b/test/files/neg/forgot-interpolator.check
index a96431841f..98440fe657 100644
--- a/test/files/neg/forgot-interpolator.check
+++ b/test/files/neg/forgot-interpolator.check
@@ -1,24 +1,21 @@
forgot-interpolator.scala:4: warning: `$bippy` looks like an interpolated identifier! Did you forget the interpolator?
- def f = "Put the $bippy in the $bippy!" // warn
+ def f = "Put the $bippy in the $bippy!" // warn 1
^
forgot-interpolator.scala:14: warning: That looks like an interpolated expression! Did you forget the interpolator?
- def f = """Put the ${println("bippy")} in the bippy!""" // warn
+ def f = """Put the ${println("bippy")} in the bippy!""" // warn 2
^
forgot-interpolator.scala:30: warning: `$beppo` looks like an interpolated identifier! Did you forget the interpolator?
- def f = "$beppo was a marx bros who saw dollars." // warn
+ def f = "$beppo was a marx bros who saw dollars." // warn 3
^
forgot-interpolator.scala:34: warning: `$aleppo` looks like an interpolated identifier! Did you forget the interpolator?
- def f = "$aleppo is a pepper and a city." // warn
+ def f = "$aleppo is a pepper and a city." // warn 4
^
-forgot-interpolator.scala:40: warning: `$bar` looks like an interpolated identifier! Did you forget the interpolator?
- def f = "$bar is private, shall we warn just in case?" // warn
+forgot-interpolator.scala:42: warning: `$bar` looks like an interpolated identifier! Did you forget the interpolator?
+ def f = "$bar is private, shall we warn just in case?" // warn 5
^
-forgot-interpolator.scala:45: warning: `$hippo` looks like an interpolated identifier! Did you forget the interpolator?
- def h = "$hippo takes an implicit" // warn
+forgot-interpolator.scala:47: warning: `$hippo` looks like an interpolated identifier! Did you forget the interpolator?
+ def h = "$hippo takes an implicit" // warn 6
^
-forgot-interpolator.scala:37: warning: private method in class Bar is never used
- private def bar = 8
- ^
error: No warnings can be incurred under -Xfatal-warnings.
-7 warnings found
+6 warnings found
one error found
diff --git a/test/files/neg/forgot-interpolator.scala b/test/files/neg/forgot-interpolator.scala
index 5067f1dce9..e007f15009 100644
--- a/test/files/neg/forgot-interpolator.scala
+++ b/test/files/neg/forgot-interpolator.scala
@@ -1,7 +1,7 @@
class A {
val bippy = 123
- def f = "Put the $bippy in the $bippy!" // warn
+ def f = "Put the $bippy in the $bippy!" // warn 1
}
class B {
@@ -11,7 +11,7 @@ class B {
}
class C {
- def f = """Put the ${println("bippy")} in the bippy!""" // warn
+ def f = """Put the ${println("bippy")} in the bippy!""" // warn 2
}
package object test {
@@ -27,21 +27,33 @@ package test {
def beppo(i: Int) = 8 * i
def beppo = 8
class Dah extends Doo {
- def f = "$beppo was a marx bros who saw dollars." // warn
+ def f = "$beppo was a marx bros who saw dollars." // warn 3
}
}
class E {
- def f = "$aleppo is a pepper and a city." // warn
+ def f = "$aleppo is a pepper and a city." // warn 4
+ def k = s"Just an interpolation of $aleppo" // no warn
}
class Bar {
private def bar = 8
+ if (bar > 8) ??? // use it to avoid extra warning
}
class Baz extends Bar {
- def f = "$bar is private, shall we warn just in case?" // warn
+ def f = "$bar is private, shall we warn just in case?" // warn 5
}
class G {
def g = "$greppo takes an arg" // no warn
def z = "$zappos takes an arg too" // no warn
- def h = "$hippo takes an implicit" // warn
+ def h = "$hippo takes an implicit" // warn 6
}
+ class J {
+ def j = 8
+ class J2 {
+ def j(i: Int) = 2 * i
+ def jj = "shadowed $j" // no warn
+ }
+ }
+ import annotation._
+ @implicitNotFound("No Z in ${A}") // no warn
+ class Z[A]
}
diff --git a/test/files/neg/newpat_unreachable.check b/test/files/neg/newpat_unreachable.check
index a928e3853a..4463e2f1a4 100644
--- a/test/files/neg/newpat_unreachable.check
+++ b/test/files/neg/newpat_unreachable.check
@@ -13,6 +13,9 @@ If you intended to match against value d in class A, you must use backticks, lik
newpat_unreachable.scala:9: warning: unreachable code due to variable pattern 'b' on line 6
case _ => println("matched neither")
^
+newpat_unreachable.scala:7: warning: unreachable code
+ case c => println("matched c")
+ ^
newpat_unreachable.scala:22: warning: patterns after a variable pattern cannot match (SLS 8.1.1)
If you intended to match against parameter b of method g, you must use backticks, like: case `b` =>
case b => 1
@@ -24,6 +27,9 @@ If you intended to match against parameter c of method h, you must use backticks
newpat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 22
case _ => 3
^
+newpat_unreachable.scala:23: warning: unreachable code
+ case c => 2
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-7 warnings found
+9 warnings found
one error found
diff --git a/test/files/neg/package-ob-case.check b/test/files/neg/package-ob-case.check
index 063a120db1..9b0ede1c6d 100644
--- a/test/files/neg/package-ob-case.check
+++ b/test/files/neg/package-ob-case.check
@@ -2,6 +2,9 @@ package-ob-case.scala:3: warning: it is not recommended to define classes/object
If possible, define class X in package foo instead.
case class X(z: Int) { }
^
+package-ob-case.scala:3: warning: class X should be placed directly in package foo instead of package object foo. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.
+ case class X(z: Int) { }
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
+two warnings found
one error found
diff --git a/test/files/neg/pat_unreachable.check b/test/files/neg/pat_unreachable.check
index b4c0e7e104..374ee4e9cf 100644
--- a/test/files/neg/pat_unreachable.check
+++ b/test/files/neg/pat_unreachable.check
@@ -9,6 +9,9 @@ If you intended to match against parameter c of method contrivedExample, you mus
pat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 22
case _ => println("matched neither")
^
+pat_unreachable.scala:23: warning: unreachable code
+ case c => println("matched c")
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-three warnings found
+four warnings found
one error found
diff --git a/test/files/neg/t2462b.check b/test/files/neg/t2462b.check
index bc0d9aa469..b3b8007a93 100644
--- a/test/files/neg/t2462b.check
+++ b/test/files/neg/t2462b.check
@@ -6,9 +6,6 @@ t2462b.scala:9: warning: Invalid implicitNotFound message for trait Meh2 in pack
The type parameter Elem referenced in the message of the @implicitNotFound annotation is not defined by trait Meh2.
trait Meh2[-From, +To]
^
-t2462b.scala:12: error: overriding method x in class thankyoupartest of type => Int;
- method x needs `override' modifier
-class testmustfail extends thankyoupartest { def x = 43 }
- ^
+error: No warnings can be incurred under -Xfatal-warnings.
two warnings found
one error found
diff --git a/test/files/neg/t2462b.flags b/test/files/neg/t2462b.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t2462b.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t2462b.scala b/test/files/neg/t2462b.scala
index 7a1389cc8e..576db4bd3f 100644
--- a/test/files/neg/t2462b.scala
+++ b/test/files/neg/t2462b.scala
@@ -7,6 +7,3 @@ trait Meh[-From, +To]
@implicitNotFound(msg = "Cannot construct a collection of type ${To} ${Elem}.")
trait Meh2[-From, +To]
-
-class thankyoupartest { def x = 42 }
-class testmustfail extends thankyoupartest { def x = 43 }
diff --git a/test/files/neg/t2462c.check b/test/files/neg/t2462c.check
new file mode 100644
index 0000000000..edeead55d6
--- /dev/null
+++ b/test/files/neg/t2462c.check
@@ -0,0 +1,7 @@
+t2462c.scala:18: error: No C of X$Y
+ f[X$Y]
+ ^
+t2462c.scala:24: error: No C of Foo[Int]
+ f[Foo[Int]]
+ ^
+two errors found
diff --git a/test/files/neg/t2462c.flags b/test/files/neg/t2462c.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/t2462c.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/t2462c.scala b/test/files/neg/t2462c.scala
new file mode 100644
index 0000000000..acf04afba9
--- /dev/null
+++ b/test/files/neg/t2462c.scala
@@ -0,0 +1,25 @@
+
+import annotation._
+
+@implicitNotFound("No C of ${ A }")
+class C[A]
+
+trait X$Y
+/* using the $$ separator for expanded names is unwise
+trait X$$Y
+trait X$$$Y
+trait X$$$$Y
+ */
+
+trait Foo[A]
+
+class Test {
+ def f[A: C] = ???
+ f[X$Y]
+/* using the $$ separator for expanded names is unwise
+ f[X$$Y]
+ f[X$$$Y]
+ f[X$$$$Y]
+ */
+ f[Foo[Int]]
+}
diff --git a/test/files/neg/t3971.check b/test/files/neg/t3971.check
new file mode 100644
index 0000000000..8685119876
--- /dev/null
+++ b/test/files/neg/t3971.check
@@ -0,0 +1,21 @@
+t3971.scala:6: error: type mismatch;
+ found : Int
+ required: String
+ f(g("abc")("def")) // g returns Int, needs String
+ ^
+t3971.scala:7: error: type mismatch;
+ found : Int(5)
+ required: String
+ f(5)
+ ^
+t3971.scala:8: error: type mismatch;
+ found : Int
+ required: String
+ f(h("abc"))
+ ^
+t3971.scala:11: error: type mismatch;
+ found : Boolean
+ required: String
+ ({"ab".reverse; "ba".equals})(0): String
+ ^
+four errors found
diff --git a/test/files/neg/t3971.scala b/test/files/neg/t3971.scala
new file mode 100644
index 0000000000..35f64fde0c
--- /dev/null
+++ b/test/files/neg/t3971.scala
@@ -0,0 +1,12 @@
+class A {
+ def f(x: String) = x
+ def g(x: String)(y: String): Int = x.length + y.length
+ def h(x: String) = x.length
+
+ f(g("abc")("def")) // g returns Int, needs String
+ f(5)
+ f(h("abc"))
+
+ // a perverse piece of code from a perverse coder
+ ({"ab".reverse; "ba".equals})(0): String
+}
diff --git a/test/files/neg/t5426.check b/test/files/neg/t5426.check
index 98f3ddaaae..c042cdcec3 100644
--- a/test/files/neg/t5426.check
+++ b/test/files/neg/t5426.check
@@ -4,12 +4,18 @@ t5426.scala:2: warning: comparing values of types Some[Int] and Int using `==' w
t5426.scala:3: warning: comparing values of types Int and Some[Int] using `==' will always yield false
def f2 = 5 == Some(5)
^
+t5426.scala:3: warning: Int and Some[Int] are unrelated: they will most likely never compare equal
+ def f2 = 5 == Some(5)
+ ^
t5426.scala:8: warning: comparing values of types Int and Some[Int] using `==' will always yield false
(x1 == x2)
^
+t5426.scala:8: warning: Int and Some[Int] are unrelated: they will most likely never compare equal
+ (x1 == x2)
+ ^
t5426.scala:9: warning: comparing values of types Some[Int] and Int using `==' will always yield false
(x2 == x1)
^
error: No warnings can be incurred under -Xfatal-warnings.
-four warnings found
+6 warnings found
one error found
diff --git a/test/files/neg/t5663-badwarneq.check b/test/files/neg/t5663-badwarneq.check
index 732e4f44d0..4b7795585b 100644
--- a/test/files/neg/t5663-badwarneq.check
+++ b/test/files/neg/t5663-badwarneq.check
@@ -25,6 +25,9 @@ t5663-badwarneq.scala:72: warning: ValueClass1 and Int are unrelated: they will
t5663-badwarneq.scala:74: warning: comparing values of types Int and ValueClass1 using `==' will always yield false
println(5 == new ValueClass1(5)) // bad
^
+t5663-badwarneq.scala:74: warning: Int and ValueClass1 are unrelated: they will never compare equal
+ println(5 == new ValueClass1(5)) // bad
+ ^
t5663-badwarneq.scala:78: warning: ValueClass2[String] and String are unrelated: they will never compare equal
println(new ValueClass2("abc") == "abc") // bad
^
@@ -38,5 +41,5 @@ t5663-badwarneq.scala:82: warning: comparing values of types ValueClass3 and Int
println(ValueClass3(5) == 5) // bad
^
error: No warnings can be incurred under -Xfatal-warnings.
-13 warnings found
+14 warnings found
one error found
diff --git a/test/files/neg/t6048.check b/test/files/neg/t6048.check
index 5e11d24fde..f8eddf5471 100644
--- a/test/files/neg/t6048.check
+++ b/test/files/neg/t6048.check
@@ -10,6 +10,9 @@ t6048.scala:13: warning: patterns after a variable pattern cannot match (SLS 8.1
t6048.scala:14: warning: unreachable code due to variable pattern on line 13
case 5 if true => x // unreachable
^
+t6048.scala:14: warning: unreachable code
+ case 5 if true => x // unreachable
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-four warnings found
+5 warnings found
one error found
diff --git a/test/files/neg/t6120.check b/test/files/neg/t6120.check
new file mode 100644
index 0000000000..a7d17e29cf
--- /dev/null
+++ b/test/files/neg/t6120.check
@@ -0,0 +1,20 @@
+t6120.scala:5: warning: postfix operator bippy should be enabled
+by making the implicit value scala.language.postfixOps visible.
+This can be achieved by adding the import clause 'import scala.language.postfixOps'
+or by setting the compiler option -language:postfixOps.
+See the Scala docs for value scala.language.postfixOps for a discussion
+why the feature should be explicitly enabled.
+ def f = null == null bippy
+ ^
+t6120.scala:5: warning: method bippy in class BooleanOps is deprecated: bobo
+ def f = null == null bippy
+ ^
+t6120.scala:5: warning: comparing values of types Null and Null using `==' will always yield true
+ def f = null == null bippy
+ ^
+t6120.scala:6: warning: method bippy in class BooleanOps is deprecated: bobo
+ def g = true.bippy
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+four warnings found
+one error found
diff --git a/test/files/neg/t6120.flags b/test/files/neg/t6120.flags
new file mode 100644
index 0000000000..04d7c7d417
--- /dev/null
+++ b/test/files/neg/t6120.flags
@@ -0,0 +1 @@
+-feature -deprecation -Xfatal-warnings \ No newline at end of file
diff --git a/test/files/neg/t6120.scala b/test/files/neg/t6120.scala
new file mode 100644
index 0000000000..425f09db47
--- /dev/null
+++ b/test/files/neg/t6120.scala
@@ -0,0 +1,7 @@
+class A {
+ implicit class BooleanOps(val b: Boolean) {
+ @deprecated("bobo", "2.11.0") def bippy() = 5
+ }
+ def f = null == null bippy
+ def g = true.bippy
+}
diff --git a/test/files/neg/t7721.check b/test/files/neg/t7721.check
index e056b9a293..ade1ca3b20 100644
--- a/test/files/neg/t7721.check
+++ b/test/files/neg/t7721.check
@@ -7,6 +7,9 @@ t7721.scala:15: warning: abstract type pattern A.this.Foo is unchecked since it
t7721.scala:19: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure
case x: Foo with Bar => x.bippy + x.barry
^
+t7721.scala:19: warning: abstract type pattern A.this.Bar is unchecked since it is eliminated by erasure
+ case x: Foo with Bar => x.bippy + x.barry
+ ^
t7721.scala:39: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure
case x: Foo with Concrete => x.bippy + x.dingo + x.conco
^
@@ -16,6 +19,9 @@ t7721.scala:43: warning: abstract type pattern B.this.Foo is unchecked since it
t7721.scala:47: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure
case x: Foo with Bar with Concrete => x.bippy + x.barry + x.dingo + x.conco + x.bongo
^
+t7721.scala:47: warning: abstract type pattern B.this.Bar is unchecked since it is eliminated by erasure
+ case x: Foo with Bar with Concrete => x.bippy + x.barry + x.dingo + x.conco + x.bongo
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-6 warnings found
+8 warnings found
one error found
diff --git a/test/files/neg/t7756b.check b/test/files/neg/t7756b.check
index 2817a7e230..e764783241 100644
--- a/test/files/neg/t7756b.check
+++ b/test/files/neg/t7756b.check
@@ -1,6 +1,9 @@
t7756b.scala:3: warning: comparing values of types Int and String using `==' will always yield false
case _ => 0 == ""
^
+t7756b.scala:3: warning: Int and String are unrelated: they will most likely never compare equal
+ case _ => 0 == ""
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-one warning found
+two warnings found
one error found
diff --git a/test/files/neg/t7848-interp-warn.check b/test/files/neg/t7848-interp-warn.check
index cbdc9f4c27..b7df6d8ce2 100644
--- a/test/files/neg/t7848-interp-warn.check
+++ b/test/files/neg/t7848-interp-warn.check
@@ -1,9 +1,12 @@
-t7848-interp-warn.scala:7: warning: `$foo` looks like an interpolated identifier! Did you forget the interpolator?
+t7848-interp-warn.scala:8: warning: `$foo` looks like an interpolated identifier! Did you forget the interpolator?
"An important $foo message!"
^
-t7848-interp-warn.scala:11: warning: That looks like an interpolated expression! Did you forget the interpolator?
+t7848-interp-warn.scala:12: warning: That looks like an interpolated expression! Did you forget the interpolator?
"A doubly important ${foo * 2} message!"
^
+t7848-interp-warn.scala:16: warning: `$bar` looks like an interpolated identifier! Did you forget the interpolator?
+ def j = s"Try using '${ "something like $bar" }' instead." // warn
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-two warnings found
+three warnings found
one error found
diff --git a/test/files/neg/t7848-interp-warn.scala b/test/files/neg/t7848-interp-warn.scala
index bb3eeff60c..3887aff8de 100644
--- a/test/files/neg/t7848-interp-warn.scala
+++ b/test/files/neg/t7848-interp-warn.scala
@@ -2,6 +2,7 @@
package test
object Test {
+ def bar = "bar"
def f = {
val foo = "bar"
"An important $foo message!"
@@ -10,4 +11,8 @@ object Test {
val foo = "bar"
"A doubly important ${foo * 2} message!"
}
+ def h = s"Try using '$$bar' instead." // no warn
+ def i = s"Try using '${ "$bar" }' instead." // no warn on space test
+ def j = s"Try using '${ "something like $bar" }' instead." // warn
+ def k = f"Try using '$bar' instead." // no warn on other std interps
}
diff --git a/test/files/neg/t7870.check b/test/files/neg/t7870.check
new file mode 100644
index 0000000000..d9db911ac1
--- /dev/null
+++ b/test/files/neg/t7870.check
@@ -0,0 +1,4 @@
+t7870.scala:1: error: in class C, multiple overloaded alternatives of constructor C define default arguments.
+class C(a: Int = 0, b: Any) {
+ ^
+one error found
diff --git a/test/files/neg/t7870.scala b/test/files/neg/t7870.scala
new file mode 100644
index 0000000000..5d48d43b3a
--- /dev/null
+++ b/test/files/neg/t7870.scala
@@ -0,0 +1,3 @@
+class C(a: Int = 0, b: Any) {
+ def this(a: Int = 0) = this(???, ???)
+}
diff --git a/test/files/neg/t7877.check b/test/files/neg/t7877.check
new file mode 100644
index 0000000000..7f7f832463
--- /dev/null
+++ b/test/files/neg/t7877.check
@@ -0,0 +1,7 @@
+t7877.scala:6: error: not found: value Y
+ case Y() => () // not allowed
+ ^
+t7877.scala:7: error: OnNext[Any] does not take parameters
+ case OnNext[Any]() => () // should *not* be allowed, but was.
+ ^
+two errors found
diff --git a/test/files/neg/t7877.scala b/test/files/neg/t7877.scala
new file mode 100644
index 0000000000..52e167f3b8
--- /dev/null
+++ b/test/files/neg/t7877.scala
@@ -0,0 +1,13 @@
+class Test {
+ val X: OnNext[Any] = null
+ def Y: OnNext[Any] = null
+ (null: Any) match {
+ case X() => () // allowed
+ case Y() => () // not allowed
+ case OnNext[Any]() => () // should *not* be allowed, but was.
+ }
+}
+
+class OnNext[+T] {
+ def unapply(x: Any) = false
+}
diff --git a/test/files/neg/unreachablechar.check b/test/files/neg/unreachablechar.check
index 121f12a0c7..a621196c56 100644
--- a/test/files/neg/unreachablechar.check
+++ b/test/files/neg/unreachablechar.check
@@ -4,6 +4,9 @@ unreachablechar.scala:4: warning: patterns after a variable pattern cannot match
unreachablechar.scala:5: warning: unreachable code due to variable pattern on line 4
case 'f' => println("not stuff?");
^
+unreachablechar.scala:5: warning: unreachable code
+ case 'f' => println("not stuff?");
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-two warnings found
+three warnings found
one error found
diff --git a/test/files/neg/warn-unused-privates.check b/test/files/neg/warn-unused-privates.check
index 9c41a33e8f..d012869c93 100644
--- a/test/files/neg/warn-unused-privates.check
+++ b/test/files/neg/warn-unused-privates.check
@@ -16,6 +16,9 @@ warn-unused-privates.scala:35: warning: private val in class Boppy is never used
warn-unused-privates.scala:42: warning: private var in trait Accessors is never used
private var v1: Int = 0 // warn
^
+warn-unused-privates.scala:42: warning: private setter in trait Accessors is never used
+ private var v1: Int = 0 // warn
+ ^
warn-unused-privates.scala:43: warning: private setter in trait Accessors is never used
private var v2: Int = 0 // warn, never set
^
@@ -59,5 +62,5 @@ warn-unused-privates.scala:102: warning: local type OtherThing is never used
type OtherThing = String // warn
^
error: No warnings can be incurred under -Xfatal-warnings.
-20 warnings found
+21 warnings found
one error found