Closed
Description
Compiler version
Minimized code
//> using options -Ycompile-scala2-library
trait A {
def foo = ???
}
Output
Scala 3
[[syntax trees at end of genBCode]] // playground.scala
package <empty> {
@SourceFile("playground.scala") trait A() extends Object {
def foo(): Nothing = ???()
}
}
Scala 2
[[syntax trees at end of jvm]] // playground.scala
package <empty> {
abstract trait A extends Object {
def foo(): Nothing = scala.Predef.???();
def /*A*/$init$(): Unit = {
()
}
}
}
Expectation
Scala 3 should follow Scala 2 rules to emit trait constructors under -Ycompile-scala2-library
.
Notes
The rules for trait constructors were briefly mentionned in #10530.