vendredi 20 mars 2015

Scala - Remove type annotation in pattern definition


class MyClass

val list: List[Any] = ...

list match {
case List(t: MyClass) =>
case _ =>
}


What's wrong with the first case? In IDEA I keep seeing a yellow indicator, telling me to "Remove type annotation from pattern definition".


Aucun commentaire:

Enregistrer un commentaire