summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t8610.check10
-rw-r--r--test/files/run/t8610.flags1
-rw-r--r--test/files/run/t8610.scala13
3 files changed, 24 insertions, 0 deletions
diff --git a/test/files/run/t8610.check b/test/files/run/t8610.check
new file mode 100644
index 0000000000..077382fb1c
--- /dev/null
+++ b/test/files/run/t8610.check
@@ -0,0 +1,10 @@
+t8610.scala:4: warning: `$name` looks like an interpolated identifier! Did you forget the interpolator?
+ 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
+ ^
+Hi, $name
diff --git a/test/files/run/t8610.flags b/test/files/run/t8610.flags
new file mode 100644
index 0000000000..edcb5f4d0c
--- /dev/null
+++ b/test/files/run/t8610.flags
@@ -0,0 +1 @@
+-Xlint:warn-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
+}