Skip to content

NoSuchMethodError when creating abstract override val #10308

@Atry

Description

@Atry
Welcome to Scala 2.12.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.

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

class A(override val f: Float) extends B

trait B {
 def f: Float = 1.0f
}

trait C extends B {
 abstract override val f = super.f + 100.0f
}

trait D extends B {
 abstract override val f = super.f + 1000.0f
}

new A(10.0f) with C with D {}

// Exiting paste mode, now interpreting.

java.lang.NoSuchMethodError: C.f$(LC;)F
  at $anon$1.$line3$$read$D$$super$f(<console>:29)
  at D.$init$(<console>:24)
  ... 30 elided

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions