This code compiles fine, but fails at runtime:

```
    val values = Set("a").toSeq.sorted
    values match {
      case Nil => println("empty")
      case h::t => println(s"h = $h")
    }

```

With the error message:

> 
> scala.MatchError: ArrayBuffer(a) (of class scala.collection.mutable.ArrayBuffer)
> 
> 
> 

I understand that somewhere in the process an `ArrayBuffer` is created, on which I cannot pattern-match like this. However, why can't the compiler tell me that this is not going to work?