Skip to content

AbstractMethodError when base class method overloads generic method from trait #8681

Open
@scabug

Description

@scabug

Repro steps:

Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :paste
// Entering paste mode (ctrl-D to finish)

trait SimpleTrait[T] {
  def myMethod(t: T): Int
  def doIt(t: T): Unit = {
    myMethod(t)
 }
}

abstract class SimpleClass[T] extends SimpleTrait[T] {
  def myMethod(t: String): Int = 5
}

class BadClass extends SimpleClass[String]

(new BadClass).doIt("foobar")

// Exiting paste mode, now interpreting.

java.lang.AbstractMethodError: BadClass.myMethod(Ljava/lang/Object;)I
	at SimpleTrait$class.doIt(<console>:13)
	at SimpleClass.doIt(<console>:17)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    backenderasurefixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions