diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-03-24 14:16:49 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-03-24 21:41:37 +0100 |
commit | 4af9ff514c531dd02c828cb912059d7aeff9ecb5 (patch) | |
tree | f086cfdb9c2f7ea1fa1c777fbf85efe11654bdad /test/files/neg | |
parent | 8d537a13999878673b8d18c2429dbd6b97728e72 (diff) | |
download | scala-4af9ff514c531dd02c828cb912059d7aeff9ecb5.tar.gz scala-4af9ff514c531dd02c828cb912059d7aeff9ecb5.tar.bz2 scala-4af9ff514c531dd02c828cb912059d7aeff9ecb5.zip |
SI-7294 Deprecate inheritance from TupleN.
The motivation is to provide static warnings
in cases like:
scala> (1, 2) match { case Seq() => 0; case _ => 1 }
res9: Int = 1
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t7294b.check | 6 | ||||
-rw-r--r-- | test/files/neg/t7294b.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t7294b.scala | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/test/files/neg/t7294b.check b/test/files/neg/t7294b.check new file mode 100644 index 0000000000..0033b72125 --- /dev/null +++ b/test/files/neg/t7294b.check @@ -0,0 +1,6 @@ +t7294b.scala:1: warning: inheritance from class Tuple2 in package scala is deprecated: Tuples will be made final in a future version. +class C extends Tuple2[Int, Int](0, 0) + ^ +error: No warnings can be incurred under -Xfatal-warnings. +one warning found +one error found diff --git a/test/files/neg/t7294b.flags b/test/files/neg/t7294b.flags new file mode 100644 index 0000000000..d1b831ea87 --- /dev/null +++ b/test/files/neg/t7294b.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/t7294b.scala b/test/files/neg/t7294b.scala new file mode 100644 index 0000000000..2ab86a8058 --- /dev/null +++ b/test/files/neg/t7294b.scala @@ -0,0 +1 @@ +class C extends Tuple2[Int, Int](0, 0)
\ No newline at end of file |