warning: use of deprecated associated function `std::error::Error::description`: use the Display implor to_string()
这是否证明了整个Display impl样板的合理性,或者我可以放弃更简单的to_string()。
如何定义foo以使其与具有math.max方法的任何类型一起工作?错误声明max不能应用于(A,A)。如果A恰好是错误中提到的任何类型,那么它可以是,这就是我想要的。这不是多态类型参数的全部要点吗?scala> def foo[A](a: A, b: A) = math.max(a,b)
<console>:9: error: overloaded method value max with alternatives