Open
Description
Minimized code
def f(xs: List[Int]) =
xs match
case init :+ last => ()
case Nil => ()
@main def run = f(List(1, 2))
https://scastie.scala-lang.org/NVdH00JGS36HLzTs7F8vhw
Output
[warn] 60 | case init :+ last =>
[warn] | ^
[warn] | match may not be exhaustive.
[warn] |
[warn] | It would fail on pattern case: List(_, _: _*)
[warn] one warning found
Expectation
There is no warning.