summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2017-03-22 14:32:53 -0700
committerGitHub <noreply@github.com>2017-03-22 14:32:53 -0700
commit60d01debd3ac4497cc0def81f6428083157d5de0 (patch)
tree0bcb828f3e8eaf97bdd0cfc6a987292d927d7ec0 /test
parentb68cc6ce6f26140ce6dfa28662ebf60de5a23ad2 (diff)
parentd16af0680d6529f1f3fedb1e23003b9f003420d0 (diff)
downloadscala-60d01debd3ac4497cc0def81f6428083157d5de0.tar.gz
scala-60d01debd3ac4497cc0def81f6428083157d5de0.tar.bz2
scala-60d01debd3ac4497cc0def81f6428083157d5de0.zip
Merge pull request #5643 from som-snytt/issue/8417
SI-8417 Check adapts of each param section
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t8417.check15
-rw-r--r--test/files/neg/t8417.flags1
-rw-r--r--test/files/neg/t8417.scala6
3 files changed, 22 insertions, 0 deletions
diff --git a/test/files/neg/t8417.check b/test/files/neg/t8417.check
new file mode 100644
index 0000000000..6ec9e1d14d
--- /dev/null
+++ b/test/files/neg/t8417.check
@@ -0,0 +1,15 @@
+t8417.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
+ signature: T.f(x: Any)(y: Any): String
+ given arguments: "hello", "world"
+ after adaptation: T.f(("hello", "world"): (String, String))
+ def g = f("hello", "world")("holy", "moly")
+ ^
+t8417.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want.
+ signature: T.f(x: Any)(y: Any): String
+ given arguments: "holy", "moly"
+ after adaptation: T.f(("holy", "moly"): (String, String))
+ def g = f("hello", "world")("holy", "moly")
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t8417.flags b/test/files/neg/t8417.flags
new file mode 100644
index 0000000000..26b215ff2d
--- /dev/null
+++ b/test/files/neg/t8417.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -Ywarn-adapted-args
diff --git a/test/files/neg/t8417.scala b/test/files/neg/t8417.scala
new file mode 100644
index 0000000000..fb6449c2d1
--- /dev/null
+++ b/test/files/neg/t8417.scala
@@ -0,0 +1,6 @@
+
+
+trait T {
+ def f(x: Any)(y: Any) = "" + x + y
+ def g = f("hello", "world")("holy", "moly")
+}