mirror of https://github.com/sbt/sbt.git
**Problem** consoleProject does not work with Scala 3 because the compiler bridge does not implement REPL binding injection (scala/scala3#5069). The bindings currentState, extracted, and cpHelpers are never injected into the REPL session, causing Not found errors. **Solution** Work around the missing binding support by storing the three runtime objects in a static holder (ConsoleProjectBindings) before launching the REPL, and generating val definitions via initialCommands that read from the holder. The original bindings are still passed to Console to preserve Scala 2 backward compatibility. Pass -Xrepl-interrupt-instrumentation:local to the REPL when the consoleProject scala instance is 3.8 or newer. In local mode the instrumented loader skips re-defining classpath classes and falls through to standard parent-first delegation, so REPL code sees the same singleton sbt.* and scala.* classes as the surrounding sbt process — while still keeping interrupt support for REPL-defined code, preserving Ctrl+C on long-running expressions like (Compile / compile).eval. --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||