diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t7623.check | 24 | ||||
-rw-r--r-- | test/files/neg/t7623.scala | 8 |
2 files changed, 13 insertions, 19 deletions
diff --git a/test/files/neg/t7623.check b/test/files/neg/t7623.check index db368dd369..de35023664 100644 --- a/test/files/neg/t7623.check +++ b/test/files/neg/t7623.check @@ -1,21 +1,15 @@ -t7623.scala:19: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*). - def f = "" match { case X(s) => } +t7623.scala:21: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime. + def g = "" match { case X(s, t) => } // warn ^ -t7623.scala:21: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*). - def g = "" match { case X(s, t) => } +t7623.scala:23: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected. + def h = "" match { case X(s, t, u @ _*) => } // warn ^ -t7623.scala:23: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*). - def h = "" match { case X(s, t, u @ _*) => } - ^ -t7623.scala:9: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*). - def f = C("") match { case C(s) => } - ^ -t7623.scala:11: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*). - def g = C("") match { case C(s, t) => } +t7623.scala:11: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime. + def g = C("") match { case C(s, t) => } // warn ^ -t7623.scala:13: warning: A repeated case parameter or extracted sequence should be matched only by a sequence wildcard (_*). - def h = C("") match { case C(s, t, u @ _*) => } +t7623.scala:13: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected. + def h = C("") match { case C(s, t, u @ _*) => } // warn ^ error: No warnings can be incurred under -Xfatal-warnings. -6 warnings found +four warnings found one error found diff --git a/test/files/neg/t7623.scala b/test/files/neg/t7623.scala index 5c40f37bc1..5334cc5f69 100644 --- a/test/files/neg/t7623.scala +++ b/test/files/neg/t7623.scala @@ -8,9 +8,9 @@ object X { def unapplySeq(a: Any): Option[(String, Seq[Int])] = Some("", List(1, trait Ctest { def f = C("") match { case C(s) => } - def g = C("") match { case C(s, t) => } + def g = C("") match { case C(s, t) => } // warn - def h = C("") match { case C(s, t, u @ _*) => } + def h = C("") match { case C(s, t, u @ _*) => } // warn def ok = C("") match { case C(s, u @ _*) => } } @@ -18,9 +18,9 @@ trait Ctest { trait Xtest { def f = "" match { case X(s) => } - def g = "" match { case X(s, t) => } + def g = "" match { case X(s, t) => } // warn - def h = "" match { case X(s, t, u @ _*) => } + def h = "" match { case X(s, t, u @ _*) => } // warn def ok = "" match { case X(s, u @ _*) => } } |