When passing null into a match expression with a Sequence Pattern, a null pointer exception occurs. But shouldn't the pattern automatically guard against it? The following case illustrates the problem:
def f(a:Array[Int]) = a match {
case Array(1, _*) => "yes"
case _ => "no"
}
Calling f(null), I expect to get "no", but I get the null pointer exception instead.