scala协变逆变理解
scala的协变、逆变、非变_汉子一枚-CSDN博客协变、逆变、非变spark的源代码中大量使用到了协变、逆变、非变,学习该知识点对我们将来阅读spark源代码很有帮助。来看一个类型转换的问题:class Pair[T]object Pair { def main(args: Array[String]): Unit = { val p1 = Pair("hello") // 编译报错,无法将p1转换为p2 v...https://blog.csdn.net/qq_45765882/article/deta
复制链接