Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SI-6623 -Yrepl-use-magic-imports avoids nesting $iw wrappers #8576
Rather than adding a wrapper object for each import in the session history,
Code is still ordinarily wrapped in a
This is a step toward 6623-like transparency.
The following stress test now completes; before it exhausted memory after 70 iterations.
I eliminated some of these failures by:
The remaining problems are:
We need some sort of story for these use cases before we could enable class-based mode by default.
- Make `ImportContext` a nested class - Avoid the constructor of the superclass `Context` needing to call methods on the unitialized subclass ImportContext by computing `isRootContext` / `depth` externally in the factory method.
Rather than adding a wrapper object for each import in the session history, just use a single wrapper preceded by the imports which have been interspersed with a magic import to bump context depth. Code is still ordinarily wrapped in a `$read` object. This is a step toward 6623-like transparency. `retronym` takes the blame for this innovation. `adriaanm` collaborated in its commission. `somsnytt` batted clean-up.
… bug By default, the parser tries to heal incomplete source files by inserting missing braces. Compilation will still error out, but any subsequent parser/type errors make more sense to the user when this healing works. The healing uses indentation to figure out the intent of the code. Wrapped REPL snippets aren't properly indented, and in the test case I added the healing seems counterproductive. This commit disables it in REPL tab completion, in line with the way that IMain parses the wrapped code for real compilation.
I was about to rebase when I realized this is on an old version of Scala. I was just doing
I'll do the hand-woven forward port of this to 2.13.x: https://github.com/scala/scala/compare/2.13.x...retronym:topic/repl-magic-forward-port?expand=1