Description
In Dotty, we've encountered a problem that the Dotty's version of ClassfileParser presumably fell behind the Scala 2's one (see scala/scala3#6136). This appears to be a specific case of a more general problem of code sharing between Scala 2 and 3. In this issue, I propose to discuss the ways we can keep the Scala 2 and 3 components DRY and in sync.
I believe the following questions need to be answered:
- What code repeats between Dotty and Scala 2?
- What considerations do we need to take into account when sharing between Dotty and Scala 2? What are the obstacles?
- How do we share the code?
Regarding the second point, I suppose one obstacle would be the coupling it creates between Dotty and Scala 2. The changes to Scala 2 and Dotty may affect each other, and this complicates experimentation.
Another consideration is that the code bases are big, and it may take a lot of work to see what can be shared and to actually share it.
@adriaanm, would love to hear your opinion on the above.