You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ 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?
The text was updated successfully, but these errors were encountered:
dwijnand
changed the title
Unsound code emitted to instantiating a inner class (defined in Java)
Unsound code emitted to instantiate a inner class (defined in Java)
Dec 18, 2020
Minimized code
Output
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?The text was updated successfully, but these errors were encountered: