List(1,2) match {
case List(1,_) => println("1 in postion 1")
case _ => println("default")
}
compiles / works fine. So do
List(1) match ...
List(3,4,5) match ...
but not
List() match ...
which results in the following error
found : Int(1)
required : Nothing
case List(1,_) => println("1 in postion 1")
Why does List() try to match List(1,_)?