File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/dotty/tools/dotc/repl Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -88,11 +88,11 @@ class CompilingInterpreter(
88
88
private var printResults : Boolean = true
89
89
private var delayOutput : Boolean = false
90
90
91
- var previousOutput : List [String ] = Nil
91
+ val previousOutput = ListBuffer .empty [String ]
92
92
93
93
override def lastOutput () = {
94
- val prev = previousOutput
95
- previousOutput = Nil
94
+ val prev = previousOutput.toList
95
+ previousOutput.clear()
96
96
prev
97
97
}
98
98
@@ -129,7 +129,7 @@ class CompilingInterpreter(
129
129
// we drop the final `$' from module classes.
130
130
out.flush()
131
131
} else {
132
- previousOutput = (/* clean*/ (msg) + " \n " ) :: previousOutput
132
+ previousOutput + = (/* clean*/ (msg) + " \n " )
133
133
}
134
134
}
135
135
}
@@ -220,7 +220,7 @@ class CompilingInterpreter(
220
220
else {
221
221
val (resultStrings, succeeded) = req.loadAndRun()
222
222
if (delayOutput)
223
- previousOutput = resultStrings.map(clean) ::: previousOutput
223
+ previousOutput ++ = resultStrings.map(clean)
224
224
else if (printResults || ! succeeded)
225
225
resultStrings.map(x => out.print(clean(x)))
226
226
if (succeeded) {
Original file line number Diff line number Diff line change @@ -41,5 +41,5 @@ trait Interpreter {
41
41
def delayOutputDuring [T ](operation : => T ): T
42
42
43
43
/** Gets the last output not printed immediately */
44
- def lastOutput (): List [String ]
44
+ def lastOutput (): Seq [String ]
45
45
}
You can’t perform that action at this time.
0 commit comments