summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/forgot-interpolator.check16
-rw-r--r--test/files/neg/t7848-interp-warn.check6
-rw-r--r--test/files/neg/t8525.check6
-rw-r--r--test/files/neg/t8525.flags1
-rw-r--r--test/files/neg/t8525.scala10
-rw-r--r--test/files/neg/t8610-arg.check9
-rw-r--r--test/files/neg/t8610-arg.scala5
-rw-r--r--test/files/neg/t8610.check11
-rw-r--r--test/files/neg/t8610.scala5
-rw-r--r--test/files/run/t8610.check2
10 files changed, 50 insertions, 21 deletions
diff --git a/test/files/neg/forgot-interpolator.check b/test/files/neg/forgot-interpolator.check
index 8988458982..8e75350518 100644
--- a/test/files/neg/forgot-interpolator.check
+++ b/test/files/neg/forgot-interpolator.check
@@ -1,25 +1,25 @@
-forgot-interpolator.scala:4: warning: `$bippy` looks like an interpolated identifier! Did you forget the interpolator?
+forgot-interpolator.scala:4: warning: possible missing interpolator: detected interpolated identifier `$bippy`
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?
+forgot-interpolator.scala:14: warning: possible missing interpolator: detected an interpolated expression
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?
+forgot-interpolator.scala:30: warning: possible missing interpolator: detected interpolated identifier `$beppo`
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?
+forgot-interpolator.scala:34: warning: possible missing interpolator: detected interpolated identifier `$aleppo`
def f = "$aleppo is a pepper and a city." // warn 4
^
-forgot-interpolator.scala:47: warning: `$hippo` looks like an interpolated identifier! Did you forget the interpolator?
+forgot-interpolator.scala:47: warning: possible missing interpolator: detected interpolated identifier `$hippo`
def h = "$hippo takes an implicit" // warn 6
^
-forgot-interpolator.scala:88: warning: `$groucho` looks like an interpolated identifier! Did you forget the interpolator?
+forgot-interpolator.scala:88: warning: possible missing interpolator: detected interpolated identifier `$groucho`
def f2 = "I salute $groucho" // warn 7
^
-forgot-interpolator.scala:89: warning: `$dingo` looks like an interpolated identifier! Did you forget the interpolator?
+forgot-interpolator.scala:89: warning: possible missing interpolator: detected interpolated identifier `$dingo`
def f3 = "I even salute $dingo" // warn 8
^
-forgot-interpolator.scala:90: warning: `$calico` looks like an interpolated identifier! Did you forget the interpolator?
+forgot-interpolator.scala:90: warning: possible missing interpolator: detected interpolated identifier `$calico`
def f4 = "I also salute $calico" // warn 9
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/t7848-interp-warn.check b/test/files/neg/t7848-interp-warn.check
index b7df6d8ce2..4cf9d55ffd 100644
--- a/test/files/neg/t7848-interp-warn.check
+++ b/test/files/neg/t7848-interp-warn.check
@@ -1,10 +1,10 @@
-t7848-interp-warn.scala:8: warning: `$foo` looks like an interpolated identifier! Did you forget the interpolator?
+t7848-interp-warn.scala:8: warning: possible missing interpolator: detected interpolated identifier `$foo`
"An important $foo message!"
^
-t7848-interp-warn.scala:12: warning: That looks like an interpolated expression! Did you forget the interpolator?
+t7848-interp-warn.scala:12: warning: possible missing interpolator: detected an interpolated expression
"A doubly important ${foo * 2} message!"
^
-t7848-interp-warn.scala:16: warning: `$bar` looks like an interpolated identifier! Did you forget the interpolator?
+t7848-interp-warn.scala:16: warning: possible missing interpolator: detected interpolated identifier `$bar`
def j = s"Try using '${ "something like $bar" }' instead." // warn
^
error: No warnings can be incurred under -Xfatal-warnings.
diff --git a/test/files/neg/t8525.check b/test/files/neg/t8525.check
new file mode 100644
index 0000000000..554ab23253
--- /dev/null
+++ b/test/files/neg/t8525.check
@@ -0,0 +1,6 @@
+t8525.scala:9: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names.
+ override def toString = name // shadowing mutable var name
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+one warning found
+one error found
diff --git a/test/files/neg/t8525.flags b/test/files/neg/t8525.flags
new file mode 100644
index 0000000000..f19af1f717
--- /dev/null
+++ b/test/files/neg/t8525.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Xlint:-warn-missing-interpolator
diff --git a/test/files/neg/t8525.scala b/test/files/neg/t8525.scala
new file mode 100644
index 0000000000..7bed04904f
--- /dev/null
+++ b/test/files/neg/t8525.scala
@@ -0,0 +1,10 @@
+
+class Named(var name: String)
+
+class X(name: String) extends Named(name) {
+ def x = "Hi, $name" // missing interp
+ def f(p: (Int, Int)): Int = p._1 * p._2
+ def g = f(3, 4) // adapted
+ def u: Unit = () // unitarian universalist
+ override def toString = name // shadowing mutable var name
+}
diff --git a/test/files/neg/t8610-arg.check b/test/files/neg/t8610-arg.check
index f2879b0d45..4f194ce84a 100644
--- a/test/files/neg/t8610-arg.check
+++ b/test/files/neg/t8610-arg.check
@@ -1,9 +1,12 @@
-t8610-arg.scala:3: warning: `$name` looks like an interpolated identifier! Did you forget the interpolator?
+t8610-arg.scala:5: warning: possible missing interpolator: detected interpolated identifier `$name`
def x = "Hi, $name" // missing interp
^
-t8610-arg.scala:6: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead
+t8610-arg.scala:9: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names.
+ override def toString = name // shadowing mutable var name
+ ^
+t8610-arg.scala:8: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead
def u: Unit = () // unitarian universalist
^
error: No warnings can be incurred under -Xfatal-warnings.
-two warnings found
+three warnings found
one error found
diff --git a/test/files/neg/t8610-arg.scala b/test/files/neg/t8610-arg.scala
index 494a3354da..7bed04904f 100644
--- a/test/files/neg/t8610-arg.scala
+++ b/test/files/neg/t8610-arg.scala
@@ -1,7 +1,10 @@
-case class X(name: String) {
+class Named(var name: String)
+
+class X(name: String) extends Named(name) {
def x = "Hi, $name" // missing interp
def f(p: (Int, Int)): Int = p._1 * p._2
def g = f(3, 4) // adapted
def u: Unit = () // unitarian universalist
+ override def toString = name // shadowing mutable var name
}
diff --git a/test/files/neg/t8610.check b/test/files/neg/t8610.check
index 7a18e55127..334a947549 100644
--- a/test/files/neg/t8610.check
+++ b/test/files/neg/t8610.check
@@ -1,15 +1,18 @@
-t8610.scala:3: warning: `$name` looks like an interpolated identifier! Did you forget the interpolator?
+t8610.scala:5: warning: possible missing interpolator: detected interpolated identifier `$name`
def x = "Hi, $name" // missing interp
^
-t8610.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
+t8610.scala:7: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
signature: X.f(p: (Int, Int)): Int
given arguments: 3, 4
after adaptation: X.f((3, 4): (Int, Int))
def g = f(3, 4) // adapted
^
-t8610.scala:6: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead
+t8610.scala:9: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names.
+ override def toString = name // shadowing mutable var name
+ ^
+t8610.scala:8: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead
def u: Unit = () // unitarian universalist
^
error: No warnings can be incurred under -Xfatal-warnings.
-three warnings found
+four warnings found
one error found
diff --git a/test/files/neg/t8610.scala b/test/files/neg/t8610.scala
index 494a3354da..7bed04904f 100644
--- a/test/files/neg/t8610.scala
+++ b/test/files/neg/t8610.scala
@@ -1,7 +1,10 @@
-case class X(name: String) {
+class Named(var name: String)
+
+class X(name: String) extends Named(name) {
def x = "Hi, $name" // missing interp
def f(p: (Int, Int)): Int = p._1 * p._2
def g = f(3, 4) // adapted
def u: Unit = () // unitarian universalist
+ override def toString = name // shadowing mutable var name
}
diff --git a/test/files/run/t8610.check b/test/files/run/t8610.check
index 077382fb1c..0e0dfc2cd3 100644
--- a/test/files/run/t8610.check
+++ b/test/files/run/t8610.check
@@ -1,4 +1,4 @@
-t8610.scala:4: warning: `$name` looks like an interpolated identifier! Did you forget the interpolator?
+t8610.scala:4: warning: possible missing interpolator: detected interpolated identifier `$name`
def x = "Hi, $name" // missing interp
^
t8610.scala:6: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.