Commit 9b225c1
committed
Don't re-add root imports to context in REPLFrontEnd
The root context for REPL compiler runs is initialized by ReplCompiler#newRun,
which contains special handling to:
1. first add the default root imports (java.lang._, scala._, Predef._)
2. then import each previous REPL wrapper in order (incl. its imports)
The result is the innermost context imports the most recent REPL wrapper
and the (nearly) outermost contexts contain the default imports.
Before this commit, the default root imports were also being added to the
(innermost) context in REPLFrontEnd#runOn, resulting in REPL definitions
being shadowed by those in java.lang._, scala._ and Predef._1 parent affe8d0 commit 9b225c1
File tree
2 files changed
+26
-2
lines changed- compiler
- src/dotty/tools/repl
- test-resources/repl
2 files changed
+26
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | | - | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments