`rest*` vs `rest @ _*` when pattern matching in Scala

36 views Asked by At
val List(a, b, c, rest*) = ...

val List(a, b, c, rest @ _*) = ...

Both seem to work, but I've had situations where the former raises the error "bad simple pattern". Only occasionally though.

Why is this?

1

There are 1 answers

0
Dmytro Mitin On BEST ANSWER