0
我用Java编写的一个NaturalComparator类/对象,并改写成斯卡拉: https://gist.github.com/319827#file_natural_comparator.scala斯卡拉未经检查的泛型警告?
不过,我不知道为什么我不需要@SuppressWarnings(“未登记”)的斯卡拉版本。 (我编译它fsc -deprecation -unchecked NaturalComparator.scala
。)
- 斯卡拉是否足够强大,以识别转换是好的吗?
- 斯卡拉编译是否假设我知道我在做什么,当我在
.asInftanceOf[...]
中使用泛型?
我希望在这种情况下编译时错误(如在Java中使用
x instanceof T
)。 – v6ak 2011-02-26 19:05:58