Closed
Description
This code compiles, but fails at runtime, as long as the numbers of type parameters of the two a
methods differ.
trait P[A]{
def a[T]: A
}
class C extends P[Int]{
def a = 1
}
object O{
def main(args: Array[String]) = {
val p: P[Int] = new C
println(p.a)
}
}
Output:
Exception in thread "main" java.lang.AbstractMethodError: C.a()Ljava/lang/Object;
at O$.main(AME.scala:10)
at O.main(AME.scala)
Metadata
Metadata
Assignees
Labels
No labels