Skip to content
Browse files

SI-6675 Test new warning under -Xoldpatmat.

This commit should be discarded when merging to master.
  • Loading branch information...
1 parent 692372c commit 78019b29745b5f9c12c51994b17f1679a74665cf @retronym retronym committed Jan 15, 2013
View
4 test/files/neg/t6675-old-patmat.check
@@ -0,0 +1,4 @@
+t6675-old-patmat.scala:10: error: extractor pattern binds a single value to a Product3 of type (Int, Int, Int)
+ "" match { case X(b) => b } // should warn under -Xlint. Not an error because of SI-6111
+ ^
+one error found
View
1 test/files/neg/t6675-old-patmat.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings -Xoldpatmat
View
13 test/files/neg/t6675-old-patmat.scala
@@ -0,0 +1,13 @@
+object X {
+ def unapply(s: String): Option[(Int,Int,Int)] = Some((1,2,3))
+}
+
+object Y {
+ def unapplySeq(s: String): Option[Seq[(Int,Int,Int)]] = Some(Seq((1,2,3)))
+}
+
+object Test {
+ "" match { case X(b) => b } // should warn under -Xlint. Not an error because of SI-6111
+
+ "" match { case Y(b) => b } // no warning
+}

0 comments on commit 78019b2

Please sign in to comment.
Something went wrong with that request. Please try again.