From 8d537a13999878673b8d18c2429dbd6b97728e72 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 24 Mar 2013 13:56:19 +0100 Subject: SI-7294 Treat TupleN as final under -Xfuture For the purposes of checkability warnings. This will warn in case of: scala> (1, 2) match { case Seq() => 0; case _ => 1 } res9: Int = 1 Given how often Tuples are used as scrutinees, this is a highly desirable place to warn. I was orginally going to unlock this under -Xlint, and could be easily convinced to go that way, given that -Xfuture is a less popular option. --- test/files/neg/t7294.check | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/files/neg/t7294.check (limited to 'test/files/neg/t7294.check') diff --git a/test/files/neg/t7294.check b/test/files/neg/t7294.check new file mode 100644 index 0000000000..f15289c1c0 --- /dev/null +++ b/test/files/neg/t7294.check @@ -0,0 +1,6 @@ +t7294.scala:4: warning: fruitless type test: a value of type (Int, Int) cannot also be a Seq[A] + (1, 2) match { case Seq() => 0; case _ => 1 } + ^ +error: No warnings can be incurred under -Xfatal-warnings. +one warning found +one error found -- cgit v1.2.3