Skip to content

Commit 3deca7d

Browse files
som-snyttretronym
authored andcommitted
Remove unneeded overrides from ReplGLobal
These seem to have been originally added as a basis for future REPL work, for instance moving away from textual code generation to using a custom typechecker to include definitions and imports from previous lines in scope. But until such work is started, lets remove the as-yet-uneeded customizations in the name of simplicity. (Original commits by Som Snytt, extended by Jason Zaugg to remove the custom typer.)
1 parent 462dc9a commit 3deca7d

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

src/repl/scala/tools/nsc/interpreter/ReplGlobal.scala

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,5 @@ trait ReplGlobal extends Global {
3030
val virtualDirectory = globalSettings.outputDirs.getSingleOutput.get
3131
new util.AbstractFileClassLoader(virtualDirectory, loader) {}
3232
}
33-
34-
override def newTyper(context: Context): Typer = new Typer(context) {
35-
override def typed(tree: Tree, mode: Mode, pt: Type): Tree = {
36-
val res = super.typed(tree, mode, pt)
37-
tree match {
38-
case Ident(name) if !tree.symbol.hasPackageFlag && !name.toString.startsWith("$") =>
39-
repldbg("typed %s: %s".format(name, res.tpe))
40-
case _ =>
41-
}
42-
res
43-
}
44-
}
45-
}
46-
47-
object replPhase extends SubComponent {
48-
val global: ReplGlobal.this.type = ReplGlobal.this
49-
val phaseName = "repl"
50-
val runsAfter = List[String]("typer")
51-
val runsRightAfter = None
52-
def newPhase(_prev: Phase): StdPhase = new StdPhase(_prev) {
53-
def apply(unit: CompilationUnit) {
54-
repldbg("Running replPhase on " + unit.body)
55-
// newNamer(rootContext(unit)).enterSym(unit.body)
56-
}
57-
}
58-
// add to initial or terminal phase to sanity check Run at construction
59-
override val requires = List("typer") // ensure they didn't -Ystop-after:parser
60-
}
61-
62-
override protected def computePhaseDescriptors: List[SubComponent] = {
63-
addToPhasesSet(replPhase, "repl")
64-
super.computePhaseDescriptors
6533
}
6634
}

0 commit comments

Comments
 (0)