Open magarciaEPFL opened 10 years ago
I'm not going to work on this any time soon and this is low priority.
I recently re-wrote how we compute the InnerClass table in scalac, this should just work for dotty, too. https://github.com/scala/scala/pull/4807.
See also the PRs linked in the original issue: https://github.com/scala/bug/issues/6759#issuecomment-292415629, which include a thorough set of test cases.
Emitting a class file involves populating its InnerClass table as per the JVM spec.
For that, GenBCode follows the same strategy GenASM does (which in turn follows what GenJVM did): intercepting via
asmClassType()
each usage of a class-name in the class file being emitted.That gives the right answer about 99.9% of the time. However as https://issues.scala-lang.org/browse/SI-6759 explains, there are cases where that approach includes too much in the InnerClasses table.
GenBCode has a solution for that,
refreshInnerClasses()
, which should be adopted as the primary mechanism (throwing away theinnerClassBufferASM
that's part of theBCInnerClassGen
trait).