プログラミング言語 Scala 7冊目
■ このスレッドは過去ログ倉庫に格納されています
0476デフォルトの名無しさん
2011/11/20(日) 20:25:13.99public class C implements Comparable { ... }
のサブクラスをscalaで定義したいのですが、ここにある問題にぶつかってしまいました。
http://scala-programming-language.1934581.n4.nabble.com/extend-from-a-Java-class-interface-implementing-Comparable-without-type-parameters-in-2-8-0-x-td2258995.html
class D extends C {
def compareTo(other:AnyRef) : Int = 0
}
とやっても
class D needs to be abstract, since method compareTo in trait Comparable of type (x$1: T)Int
is not defined (Note that T does not match AnyRef)
というエラーになります。
なにか回避策はないでしょうか?
■ このスレッドは過去ログ倉庫に格納されています