Description
This takes on several different forms, but it's super fun and varied and all stems from the same place: whenever the CodeCache fills up, Dotty ceases to function correctly. Here's an example of one error:
***** missing reference, looking for StepperShape/T in package scala.collection
decls = Scope{
abstract trait StrictOptimizedMapOps
[
private[this] type K
The more common symptom is LinkError
s arising from lambdas inside the compiler itself, but it drifts around nondeterministically.
You can reproduce this by cloning series/3.4.x
from typelevel/cats-effect and running sbt -J-Xmx16g clean +compile
. The CodeCache usually fills up during the second stage of the cross build (Scala 2.13) or early in the third stage (Scala 3.2). Once it is full, a Dotty crash is inevitable. The only workaround is to exit the JVM and re-run the Scala 3 cross-build, which succeeds.
It's worth noting that NSC does not crash when the CodeCache fills, it simply gets very slow (which is expected). It seems to me that correctness should not depend on the JIT.