Closed
Description
Minimized code
public class A {
public class B {}
}
object Test {
def main(args: Array[String]): Unit = {
val a = new A
new a.B
}
}
Output
$ echo 'public class A { public class B {} }' > A.java &&
> echo 'object Test { def main(args: Array[String]): Unit = { val a = new A; new a.B } }' > Test.scala &&
> scalac3 A.java Test.scala &&
> javac A.java &&
> scala3 Test
Exception in thread "main" java.lang.NoSuchMethodError: A$B: method 'void <init>()' not found
at Test$.main(Test.scala:1)
at Test.main(Test.scala)
Expectation
No boom. Discovered while testing MiMa with Scala 3 (there was a test that asserts that making an inner class a nested class (by making it static
) is binary incompatible). This one I consider pretty serious. The equivalent in Scala works, so perhaps it needn't be a blocker for 3.0?