summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2014-07-16 12:25:34 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2014-07-16 12:25:34 +0200
commit04cb634ec4564c6ee3bd34c3cef899537c3787ba (patch)
tree2acaa0c06544acd35aa286f56dba368996748fad /test/files/run
parent0f8b07a8d7deda602a41859a175b0b46bb113d51 (diff)
parent3b89c168b4926139f7295183fdc1903f6f553798 (diff)
downloadscala-04cb634ec4564c6ee3bd34c3cef899537c3787ba.tar.gz
scala-04cb634ec4564c6ee3bd34c3cef899537c3787ba.tar.bz2
scala-04cb634ec4564c6ee3bd34c3cef899537c3787ba.zip
Merge pull request #3792 from som-snytt/issue/8525
SI-8525 -Xlint:nowarn-missing-interpolator
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t8610.check13
-rw-r--r--test/files/run/t8610.flags1
-rw-r--r--test/files/run/t8610.scala13
3 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/t8610.check b/test/files/run/t8610.check
new file mode 100644
index 0000000000..fde82d5109
--- /dev/null
+++ b/test/files/run/t8610.check
@@ -0,0 +1,13 @@
+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.
+ 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:7: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead
+ def u: Unit = () // unitarian universalist
+ ^
+Hi, $name
diff --git a/test/files/run/t8610.flags b/test/files/run/t8610.flags
new file mode 100644
index 0000000000..4195dec383
--- /dev/null
+++ b/test/files/run/t8610.flags
@@ -0,0 +1 @@
+-Xlint:adapted-args
diff --git a/test/files/run/t8610.scala b/test/files/run/t8610.scala
new file mode 100644
index 0000000000..dd9e8e861e
--- /dev/null
+++ b/test/files/run/t8610.scala
@@ -0,0 +1,13 @@
+
+// flags don't warn on u
+case class X(name: String) {
+ 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
+}
+
+object Test extends App {
+ // poignant demonstration
+ Console println X("Bob").x
+}