Por que o conjunto imutável do Scala não é covariante em seu tipo?
EDITA: Reescreveu esta pergunta com base na resposta original
Oscala.collection.immutable.Set
class não é covariante em seu parâmetro de tipo. Por que é isso
import scala.collection.immutable._
def foo(s: Set[CharSequence]): Unit = {
println(s)
}
def bar(): Unit = {
val s: Set[String] = Set("Hello", "World");
foo(s); //DOES NOT COMPILE, regardless of whether type is declared
//explicitly in the val s declaration
}