Open pauldraper opened 6 years ago
Can you reproduce in a scripted test and submit a PR with the test marked as pending?
@adriaanm @lrytz This looks like a compiler bug in genbcode. I cannot not reproduce the issue, but Zinc is not at fault here since the error happens in the first compilation of the modified sources (not in subsequent versions where the zinc analysis is performed). Do you have any idea of what could be going on here? Looks related to the handling of package objects.
but Zinc is not at fault here since the error happens in the first compilation of the modified sources
Zinc is assuming that compiling the modified sources by themselves should always work, but it looks like this assumption is broken when files refer to each other, I've created a repo to illustrate this and reproduce the bug: https://github.com/smarter/trait-class-bug/commits/master
Because Zinc knows that A.scala refers to symbols in B.scala, and B.scala refers to symbols in A.scala, it should never attempt to compile one of those without the other, even for the first compilation of modified sources.
Using sbt 1.2.3, Scala 2.12.6
A clean fixes the compilation.