3
Scala'nın değişmez Seti neden türünde eşdeğişken değil?
DÜZENLEME : Bu soruyu orijinal cevaba göre yeniden yazdı scala.collection.immutable.SetSınıf kendi türü parametresinde covariant değil. Bu neden? 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 …