SI-6623 -Yrepl-use-magic-imports avoids nesting $iw wrappers#79
Closed
SI-6623 -Yrepl-use-magic-imports avoids nesting $iw wrappers#79
Conversation
(For 2.12.x's eyes only.)
Use vals to cache a single instance of stateless CanBuildFrom instances.
These are cast by the existing `implicit def` to the suitable generic
type. This pattern was already used in some places -- this PR applies
it systematically across `collection.{mutable,immutable}`.
The `CanBuildFrom` instances for arrays and wrapped arrays are
cached for each primitive type, Unit, and Object. Each of these
instances is backed by a dedicated subclass of CanBuildFrom that
avoids subsequent dispatch on the `ClassTag[T]`.
[nomerge] Backport windows test fix
order matches in expected frequency order (Array, WrappedArray + associated builders, and ClassTag.newArray) avoid extra def in BitSets don't optimise for NoBuilder cases
two more tests for apparently-fixed issues
[nomerge] ConcatIterator.last advances
[backport] Import travis caching config and JDK install from scala-dev
use direct vals where no casting is required
6f5ae9e to
16778e7
Compare
Avoid allocations of reusable CanBuildFroms
The test allocates 16*16 MB, so testing with a 192 MB heap should be safe to catch the leak. Tested with running the test in a `while true` loop locally - constanly fails with 192 MB on 2.13.1 - constantly succeeds with 192 MB on 2.13.2-bin-9ef8fc3 - flaky with 128 MB on 2.13.2-bin-9ef8fc3 (cherry picked from commit ffcffc6)
ca0d6ee to
6527e07
Compare
[backport] Bump Xmx for type-tag-leak
- 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.
To be reverted.
… 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.
- add comments describing a problem I discovered with imports
and a possible solution
- Make strip wrappers from REPL output for the wrappers generated in this mode
6527e07 to
952e561
Compare
952e561 to
cfaf9f8
Compare
This detail changes under -Yrepl-class-based. We prefer tests that operate under either mode.
cfaf9f8 to
b63b7dc
Compare
b63b7dc to
50c74cd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
$readobject.This is a step toward 6623-like transparency.
retronymtakes the blame for this innovation.adriaanmcollaborated in its commission.somsnyttbatted clean-up.