summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-01-15 14:11:08 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-01-15 14:11:08 -0800
commit0e8984100709658588c67d097452b8606c12d750 (patch)
treeb2fb27d6fc66320947de6d30a22a9d4d4d03e651 /test/files/neg
parenta7de84d24aafb554019ebebff36a18c966568a30 (diff)
parentc5567e2700dfe6c19d968c2285821ef4ab8a8e6c (diff)
downloadscala-0e8984100709658588c67d097452b8606c12d750.tar.gz
scala-0e8984100709658588c67d097452b8606c12d750.tar.bz2
scala-0e8984100709658588c67d097452b8606c12d750.zip
Merge pull request #3260 from soc/SI-8035
Deprecate automatic () insertion in argument lists
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/t4851.check8
-rw-r--r--test/files/neg/t4851.flags2
-rw-r--r--test/files/neg/t8035-deprecated.check21
-rw-r--r--test/files/neg/t8035-deprecated.flags1
-rw-r--r--test/files/neg/t8035-deprecated.scala10
-rw-r--r--test/files/neg/t8035-removed.check16
-rw-r--r--test/files/neg/t8035-removed.flags1
-rw-r--r--test/files/neg/t8035-removed.scala10
8 files changed, 64 insertions, 5 deletions
diff --git a/test/files/neg/t4851.check b/test/files/neg/t4851.check
index 4f2919807e..132dd91b50 100644
--- a/test/files/neg/t4851.check
+++ b/test/files/neg/t4851.check
@@ -1,10 +1,10 @@
-S.scala:2: warning: Adapting argument list by inserting (): leaky (Object-receiving) target makes this especially dangerous.
+S.scala:2: warning: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
signature: J(x: Any): J
given arguments: <none>
after adaptation: new J((): Unit)
val x1 = new J
^
-S.scala:3: warning: Adapting argument list by inserting (): leaky (Object-receiving) target makes this especially dangerous.
+S.scala:3: warning: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
signature: J(x: Any): J
given arguments: <none>
after adaptation: new J((): Unit)
@@ -28,13 +28,13 @@ S.scala:7: warning: Adapting argument list by creating a 3-tuple: this may not b
after adaptation: new Some((1, 2, 3): (Int, Int, Int))
val y2 = new Some(1, 2, 3)
^
-S.scala:9: warning: Adapting argument list by inserting (): this is unlikely to be what you want.
+S.scala:9: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
signature: J2[T](x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
val z1 = new J2
^
-S.scala:10: warning: Adapting argument list by inserting (): this is unlikely to be what you want.
+S.scala:10: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
signature: J2[T](x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
diff --git a/test/files/neg/t4851.flags b/test/files/neg/t4851.flags
index 0545cb8b84..ca0d0a0ba3 100644
--- a/test/files/neg/t4851.flags
+++ b/test/files/neg/t4851.flags
@@ -1 +1 @@
--Ywarn-adapted-args -Xfatal-warnings
+-Ywarn-adapted-args -Xfatal-warnings -deprecation
diff --git a/test/files/neg/t8035-deprecated.check b/test/files/neg/t8035-deprecated.check
new file mode 100644
index 0000000000..01f27e5310
--- /dev/null
+++ b/test/files/neg/t8035-deprecated.check
@@ -0,0 +1,21 @@
+t8035-deprecated.scala:2: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
+ signature: GenSetLike.apply(elem: A): Boolean
+ given arguments: <none>
+ after adaptation: GenSetLike((): Unit)
+ List(1,2,3).toSet()
+ ^
+t8035-deprecated.scala:5: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
+ signature: A(x: T): Foo.A[T]
+ given arguments: <none>
+ after adaptation: new A((): Unit)
+ new A
+ ^
+t8035-deprecated.scala:9: warning: Adaptation of argument list by inserting () has been deprecated: leaky (Object-receiving) target makes this especially dangerous.
+ signature: Format.format(x$1: Any): String
+ given arguments: <none>
+ after adaptation: Format.format((): Unit)
+ sdf.format()
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+three warnings found
+one error found
diff --git a/test/files/neg/t8035-deprecated.flags b/test/files/neg/t8035-deprecated.flags
new file mode 100644
index 0000000000..c6bfaf1f64
--- /dev/null
+++ b/test/files/neg/t8035-deprecated.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings
diff --git a/test/files/neg/t8035-deprecated.scala b/test/files/neg/t8035-deprecated.scala
new file mode 100644
index 0000000000..6423157530
--- /dev/null
+++ b/test/files/neg/t8035-deprecated.scala
@@ -0,0 +1,10 @@
+object Foo {
+ List(1,2,3).toSet()
+
+ class A[T](val x: T)
+ new A
+
+ import java.text.SimpleDateFormat
+ val sdf = new SimpleDateFormat("yyyyMMdd-HH0000")
+ sdf.format()
+}
diff --git a/test/files/neg/t8035-removed.check b/test/files/neg/t8035-removed.check
new file mode 100644
index 0000000000..e24a0b4e63
--- /dev/null
+++ b/test/files/neg/t8035-removed.check
@@ -0,0 +1,16 @@
+t8035-removed.scala:2: error: Adaptation of argument list by inserting () has been removed.
+ signature: GenSetLike.apply(elem: A): Boolean
+ given arguments: <none>
+ List(1,2,3).toSet()
+ ^
+t8035-removed.scala:5: error: Adaptation of argument list by inserting () has been removed.
+ signature: A(x: T): Foo.A[T]
+ given arguments: <none>
+ new A
+ ^
+t8035-removed.scala:9: error: Adaptation of argument list by inserting () has been removed.
+ signature: Format.format(x$1: Any): String
+ given arguments: <none>
+ sdf.format()
+ ^
+three errors found
diff --git a/test/files/neg/t8035-removed.flags b/test/files/neg/t8035-removed.flags
new file mode 100644
index 0000000000..29f4ede37a
--- /dev/null
+++ b/test/files/neg/t8035-removed.flags
@@ -0,0 +1 @@
+-Xfuture
diff --git a/test/files/neg/t8035-removed.scala b/test/files/neg/t8035-removed.scala
new file mode 100644
index 0000000000..6423157530
--- /dev/null
+++ b/test/files/neg/t8035-removed.scala
@@ -0,0 +1,10 @@
+object Foo {
+ List(1,2,3).toSet()
+
+ class A[T](val x: T)
+ new A
+
+ import java.text.SimpleDateFormat
+ val sdf = new SimpleDateFormat("yyyyMMdd-HH0000")
+ sdf.format()
+}