-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
Description
reproduction steps
using Scala 2.13.4
val List(x, y) = List(1, 2)
problem
Warning appears:
[error] It would fail on the following inputs: List(_), Nil
[error] val List(x, y) = List(1, 2)
There wasn't a warning until 2.13.4.
Should the new patmat strictness (which is awesome btw) apply to destructures like this? It would be valuable in this case:
val a = List(1, 2)
val List(x, y) = a
but when the right-hand side is a single known and specific pattern (in our case _ :: _ :: Nil
), the warning is spurious.