Open
Description
Compiler version
3.5.2
Minimized code
object TraitExtendingClass {
abstract class A()(
implicit
val x: Int = 3
)
trait B extends A
@main def main(): Unit = {
val b = new B {} //<-- error happens here
val c = new B() {} //<-- error happens here
println(b.x)
}
}
Output
[Error] /xxx/TraitExtendingClass.scala:14:13: method $lessinit$greater$default$1 in object A must be called with () argument
No idea where $lessinit$greater$default$
came from
Expectation
the error message should be like "trait B has to be constructed with a constructor of class A"
In Scala 2.13 this actually succeeded (because of implicit eta-reduction of 0-arity constructor), which may explained the confusing error message