summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/Completion.scala1
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ILoop.scala32
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala1
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineHistory.scala56
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineReader.scala11
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/Power.scala1
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala1
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/package.scala10
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala95
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/session/History.scala (renamed from src/compiler/scala/tools/nsc/interpreter/History.scala)5
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala55
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala62
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/session/package.scala23
-rw-r--r--src/compiler/scala/tools/nsc/io/File.scala9
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala2
16 files changed, 277 insertions, 89 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/Completion.scala b/src/compiler/scala/tools/nsc/interpreter/Completion.scala
index f9514c9379..86f48b9d69 100644
--- a/src/compiler/scala/tools/nsc/interpreter/Completion.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/Completion.scala
@@ -6,7 +6,6 @@
package scala.tools.nsc
package interpreter
-import java.util.{ List => JList }
import Completion._
/** An implementation-agnostic completion interface which makes no
diff --git a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
index c7739b8a8a..5dfd5da76c 100644
--- a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
@@ -10,8 +10,9 @@ import Predef.{ println => _, _ }
import java.io.{ BufferedReader, FileReader, PrintWriter }
import scala.sys.process.Process
+import session._
import scala.tools.nsc.interpreter.{ Results => IR }
-import scala.tools.util.{ SignalManager, Javap }
+import scala.tools.util.{ SignalManager, Signallable, Javap }
import scala.annotation.tailrec
import scala.util.control.Exception.{ ignoring }
import scala.collection.mutable.ListBuffer
@@ -48,13 +49,18 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
def interpreter = intp
@deprecated("Use `intp` instead.")
- def interpreter_= (i: Interpreter){
- intp = i
- }
+ def interpreter_= (i: Interpreter): Unit = intp = i
+
+ def history = in.history
/** The context class loader at the time this object was created */
protected val originalClassLoader = Thread.currentThread.getContextClassLoader
+ // Install a signal handler so we can be prodded.
+ private val signallable =
+ if (isReplDebug) Signallable("Dump repl state.")(dumpCommand(""))
+ else null
+
// classpath entries added via :cp
var addedClasspath: String = ""
@@ -157,13 +163,13 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
/** Show the history */
def printHistory(xs: List[String]): Result = {
- if (in.history eq NoHistory)
+ if (history eq NoHistory)
return "No history available."
val defaultLines = 20
- val current = in.history.index
+ val current = history.index
val count = try xs.head.toInt catch { case _: Exception => defaultLines }
- val lines = in.history.asStrings takeRight count
+ val lines = history.asStrings takeRight count
val offset = current - lines.size + 1
for ((line, index) <- lines.zipWithIndex)
@@ -178,9 +184,9 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
/** Search the history */
def searchHistory(_cmdline: String) {
val cmdline = _cmdline.toLowerCase
- val offset = in.history.index - in.history.size + 1
+ val offset = history.index - history.size + 1
- for ((line, index) <- in.history.asStrings.zipWithIndex ; if line.toLowerCase contains cmdline)
+ for ((line, index) <- history.asStrings.zipWithIndex ; if line.toLowerCase contains cmdline)
println("%d %s".format(index + offset, line))
}
@@ -211,13 +217,19 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter)
/** Power user commands */
val powerCommands: List[LoopCommand] = {
List(
- NoArgs("dump", "displays a view of the interpreter's internal state", power.toString _),
+ LineArg("dump", "displays a view of the interpreter's internal state", dumpCommand),
LineArg("phase", "set the implicit phase for power commands", phaseCommand),
LineArg("symfilter", "change the filter for symbol printing", symfilterCmd),
LineArg("wrap", "code to wrap around all executions", wrapCommand)
)
}
+ private def dumpCommand(line: String): Result = {
+ println(power)
+ history.asStrings takeRight 30 foreach println
+ in.redrawLine()
+ }
+
private val typeTransforms = List(
"scala.collection.immutable." -> "immutable.",
"scala.collection.mutable." -> "mutable.",
diff --git a/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala b/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala
index 3f466780e9..782fd52ab2 100644
--- a/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala
@@ -9,6 +9,7 @@ package interpreter
import java.io.IOException
import java.nio.channels.ClosedByInterruptException
import scala.util.control.Exception._
+import session.History
import InteractiveReader._
import Properties.isMac
diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
index 2a19c6fb95..dfcdca04f6 100644
--- a/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
@@ -8,8 +8,6 @@ package interpreter
import scala.tools.jline._
import scala.tools.jline.console.completer._
-import java.util.{ List => JList }
-import util.returning
import Completion._
import collection.mutable.ListBuffer
diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineHistory.scala b/src/compiler/scala/tools/nsc/interpreter/JLineHistory.scala
deleted file mode 100644
index e9be7141f1..0000000000
--- a/src/compiler/scala/tools/nsc/interpreter/JLineHistory.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-/* NSC -- new Scala compiler
- * Copyright 2005-2011 LAMP/EPFL
- * @author Paul Phillips
- */
-
-package scala.tools.nsc
-package interpreter
-
-import java.io.File
-import java.util.{ List => JList }
-import scala.tools.jline.console.ConsoleReader
-import scala.tools.jline.console.completer._
-import scala.tools.jline.console.history._
-import scala.tools.jline.console.history.{ FileHistory, PersistentHistory, History => JHistory }
-import scala.tools.jline.console.history.History.{ Entry => JEntry }
-import scala.tools.jline.console.ConsoleReader
-import scala.collection.JavaConverters._
-import Properties.userHome
-
-/** A wrapper for JLine's History.
- */
-class JLineHistory(val jhistory: JHistory) extends History {
- def asJavaList = jhistory.entries()
- def asStrings = asList map (_.value.toString)
- def asList: List[JEntry] = asJavaList.asScala.toList
- def index = jhistory.index()
- def size = jhistory.size()
-
- def grep(s: String) = asStrings filter (_ contains s)
- def flush() = jhistory match {
- case x: PersistentHistory => x.flush()
- case _ => ()
- }
-}
-
-object JLineHistory {
- val ScalaHistoryFile = ".scala_history"
-
- def apply() = new JLineHistory(
- try newFile()
- catch { case x : Exception =>
- Console.println("Error creating file history: memory history only. " + x)
- newMemory()
- }
- )
-
- def newMemory() = new MemoryHistory()
- def newFile() = new FileHistory(new File(userHome, ScalaHistoryFile)) {
- // flush after every add to avoid installing a shutdown hook.
- // (The shutdown hook approach also loses history when they aren't run.)
- override def add(item: CharSequence): Unit = {
- super.add(item)
- flush()
- }
- }
-}
diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
index f0868046b1..9ca10b9e6b 100644
--- a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
@@ -7,22 +7,17 @@ package scala.tools.nsc
package interpreter
import java.io.File
-import java.util.{ List => JList }
import scala.tools.jline.console.ConsoleReader
import scala.tools.jline.console.completer._
-import scala.tools.jline.console.history._
-import scala.tools.jline.console.history.{ FileHistory, PersistentHistory, History => JHistory }
-import scala.tools.jline.console.history.History.{ Entry => JEntry }
-import scala.tools.jline.console.ConsoleReader
+import session._
import scala.collection.JavaConverters._
-import Properties.userHome
import Completion._
import io.Streamable.slurp
/** Reads from the console using JLine */
class JLineReader(val completion: Completion) extends InteractiveReader {
val interactive = true
- lazy val history = JLineHistory()
+ lazy val history: JLineHistory = JLineHistory()
lazy val keyBindings =
try KeyBinding parse slurp(term.getDefaultBindings)
catch { case _: Exception => Nil }
@@ -50,7 +45,7 @@ class JLineReader(val completion: Completion) extends InteractiveReader {
val r = new ConsoleReader()
r setBellEnabled false
if (history ne NoHistory)
- r setHistory history.jhistory
+ r setHistory history
if (completion ne NoCompletion) {
r addCompleter argCompletor
diff --git a/src/compiler/scala/tools/nsc/interpreter/Power.scala b/src/compiler/scala/tools/nsc/interpreter/Power.scala
index dd0b05747b..7770f29a2e 100644
--- a/src/compiler/scala/tools/nsc/interpreter/Power.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/Power.scala
@@ -8,6 +8,7 @@ package interpreter
import scala.collection.{ mutable, immutable }
import scala.tools.nsc.util.{ BatchSourceFile }
+import session.{ History }
/** A class for methods to be injected into the intp in power mode.
*/
diff --git a/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala b/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala
index 0e3b7412c8..d8181e1793 100644
--- a/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala
@@ -7,6 +7,7 @@ package scala.tools.nsc
package interpreter
import java.io.{ BufferedReader, PrintWriter }
+import session.NoHistory
/** Reads using standard JDK API */
class SimpleReader(
diff --git a/src/compiler/scala/tools/nsc/interpreter/package.scala b/src/compiler/scala/tools/nsc/interpreter/package.scala
index 80040be8d0..5f231190eb 100644
--- a/src/compiler/scala/tools/nsc/interpreter/package.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/package.scala
@@ -24,18 +24,18 @@ package scala.tools.nsc
*/
package object interpreter {
private[nsc] val DebugProperty = "scala.repl.debug"
+ private[nsc] val TraceProperty = "scala.repl.trace"
private[nsc] val PowerProperty = "scala.repl.power"
- private[nsc] var _debug = false
- private[nsc] def isReplDebug = _debug || (sys.props contains DebugProperty)
+ private[nsc] var isReplDebug = sys.props contains DebugProperty // Also set by -Yrepl-debug
type JClass = java.lang.Class[_]
private[nsc] implicit def enrichClass[T](clazz: Class[T]) = new RichClass[T](clazz)
/** Debug output */
- def repldbg(msg: String) = if (isReplDebug) Console println msg
+ private[nsc] def repldbg(msg: String) = if (isReplDebug) Console println msg
/** Tracing */
- def tracing[T](msg: String)(x: T): T = {
+ private[nsc] def tracing[T](msg: String)(x: T): T = {
if (isReplDebug)
println("(" + msg + ") " + x)
@@ -46,7 +46,7 @@ package object interpreter {
(s.length >= 2) && (s.head == s.last) && ("\"'" contains s.head)
/** Class objects */
- def classForName(name: String): Option[JClass] =
+ private[nsc] def classForName(name: String): Option[JClass] =
try Some(Class forName name)
catch { case _: ClassNotFoundException | _: SecurityException => None }
}
diff --git a/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala b/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala
new file mode 100644
index 0000000000..614df996f1
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/interpreter/session/FileBackedHistory.scala
@@ -0,0 +1,95 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.nsc
+package interpreter
+package session
+
+import scala.tools.nsc.io._
+import FileBackedHistory._
+
+/** TODO: file locking.
+ */
+trait FileBackedHistory extends JLineHistory with JPersistentHistory {
+ def maxSize: Int
+ protected lazy val historyFile: File = defaultFile
+ protected def useShutdownHook = true
+
+ // A tempfile holding only the last few lines of input
+ private val bufferFile = File.makeTemp("scala_history")
+ private var bufferWriter = bufferFile.printWriter()
+
+ // flush to the permanent log every `flushFrequency` lines
+ protected def flushFrequency: Int = if (useShutdownHook) 15 else 5
+ private var flushCounter: Int = flushFrequency
+
+ private def autoflush(): Unit = {
+ flushCounter -= 1
+ if (flushCounter <= 0) {
+ flush()
+ flushCounter = flushFrequency
+ }
+ }
+
+ locally {
+ load()
+ if (useShutdownHook)
+ sys addShutdownHook flush()
+ }
+ private def drainBufferFile() = {
+ if (bufferWriter != null)
+ bufferWriter.close()
+
+ try bufferFile.lines().toList map (_ + "\n")
+ finally bufferWriter = bufferFile.printWriter()
+ }
+
+ private var isPersistent = true
+ def withoutSaving[T](op: => T): T = {
+ val saved = isPersistent
+ isPersistent = false
+ try op
+ finally isPersistent = saved
+ }
+ def addLineToFile(item: CharSequence): Unit = {
+ if (isPersistent) {
+ bufferWriter println item
+ autoflush()
+ }
+ }
+
+ protected def sync(): Unit = {
+ val lines = asStrings map (_ + "\n")
+ historyFile.writeAll(lines: _*)
+ }
+
+ def load() = {
+ val lines = historyFile.lines().toIndexedSeq
+ repldbg("Loading " + lines.size + " into history.")
+
+ // bypass the tempfile buffer
+ withoutSaving(lines takeRight maxSize foreach add)
+ // truncate the main history file if it's too big.
+ if (lines.size > maxSize) {
+ repldbg("File exceeds maximum size: truncating to " + maxSize + " entries.")
+ sync()
+ }
+ }
+ def flush(): Unit = {
+ val toAppend = drainBufferFile()
+ repldbg("Moving " + toAppend.size + " lines from buffer to permanent history.")
+ historyFile.appendAll(toAppend: _*)
+ }
+ def purge(): Unit = historyFile.truncate()
+}
+
+object FileBackedHistory {
+ // val ContinuationChar = '\003'
+ // val ContinuationNL: String = Array('\003', '\n').mkString
+ import Properties.userHome
+
+ def defaultFileName = ".scala_history"
+ def defaultFile: File = File(Path(userHome) / defaultFileName)
+}
diff --git a/src/compiler/scala/tools/nsc/interpreter/History.scala b/src/compiler/scala/tools/nsc/interpreter/session/History.scala
index 246cea12dd..5e1aba20f1 100644
--- a/src/compiler/scala/tools/nsc/interpreter/History.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/session/History.scala
@@ -5,23 +5,22 @@
package scala.tools.nsc
package interpreter
+package session
/** An implementation-agnostic history interface which makes no
- * reference to the jline classes.
+ * reference to the jline classes. Very sparse right now.
*/
trait History {
def asStrings: List[String]
def index: Int
def size: Int
def grep(s: String): List[String]
- def flush(): Unit
}
object NoHistory extends History {
def asStrings = Nil
def grep(s: String) = Nil
def index = 0
def size = 0
- def flush() = ()
}
object History {
diff --git a/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala b/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala
new file mode 100644
index 0000000000..195a94f7af
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/interpreter/session/JLineHistory.scala
@@ -0,0 +1,55 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.nsc
+package interpreter
+package session
+
+/** A straight scalification of the jline interface which mixes
+ * in the sparse jline-independent one too.
+ */
+trait JLineHistory extends JHistory with History {
+ def size: Int
+ def isEmpty: Boolean
+ def index: Int
+ def clear(): Unit
+ def get(index: Int): CharSequence
+ def add(line: CharSequence): Unit
+ def replace(item: CharSequence): Unit
+
+ def entries(index: Int): JListIterator[JEntry]
+ def entries(): JListIterator[JEntry]
+ def iterator: JIterator[JEntry]
+
+ def current(): CharSequence
+ def previous(): Boolean
+ def next(): Boolean
+ def moveToFirst(): Boolean
+ def moveToLast(): Boolean
+ def moveTo(index: Int): Boolean
+ def moveToEnd(): Unit
+}
+
+object JLineHistory {
+ class JLineFileHistory extends SimpleHistory with FileBackedHistory {
+ override def add(item: CharSequence): Unit = {
+ if (last == item)
+ repldbg("Ignoring duplicate entry '" + item + "'")
+ else {
+ super.add(item)
+ addLineToFile(item)
+ }
+ }
+ override def toString = "History(size = " + size + ", index = " + index + ")"
+ }
+
+ def apply(): JLineHistory =
+ try { new JLineFileHistory }
+ catch { case x: Exception =>
+ Console.println("Error creating file history: memory history only. " + x)
+ util.Exceptional(x).show()
+ new SimpleHistory()
+ }
+} \ No newline at end of file
diff --git a/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala b/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala
new file mode 100644
index 0000000000..28173534e4
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/interpreter/session/SimpleHistory.scala
@@ -0,0 +1,62 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.nsc
+package interpreter
+package session
+
+import scala.collection.mutable.{ Buffer, ListBuffer }
+import scala.collection.JavaConverters._
+
+class SimpleHistory extends JLineHistory {
+ private var _index: Int = 0
+ private val buf: Buffer[String] = new ListBuffer[String]
+ private def toEntries(): Seq[JEntry] = buf.zipWithIndex map { case (x, i) => Entry(i, x) }
+ private def setTo(num: Int) = { _index = num ; true }
+ private def minusOne = { _index -= 1 ; true }
+ private def plusOne = { _index += 1 ; true }
+ private def lastIndex = size - 1
+ private def fail(msg: String): String = {
+ repldbg("Internal error in history(size %d, index %d): %s".format(
+ size, index, msg)
+ )
+ ""
+ }
+
+ case class Entry(index: Int, value: CharSequence) extends JEntry {
+ override def toString = value
+ }
+
+ def maxSize: Int = 2500
+ def last = if (isEmpty) fail("last") else buf.last
+
+ def size = buf.size
+ def index = _index
+ def isEmpty = buf.isEmpty
+ def clear() = buf.clear()
+ def get(idx: Int): CharSequence = buf(idx)
+ def add(item: CharSequence): Unit = buf += item
+ def replace(item: CharSequence): Unit = {
+ buf trimEnd 1
+ add(item)
+ }
+ def entries(idx: Int): JListIterator[JEntry] = toEntries().asJava.listIterator(idx)
+ def entries(): JListIterator[JEntry] = toEntries().asJava.listIterator()
+ def iterator: JIterator[JEntry] = toEntries().iterator.asJava
+
+ def current() = if (index >= 0 && index < buf.size) buf(index) else fail("current()")
+ def previous() = (index > 0) && minusOne
+ def next() = (index <= lastIndex) && plusOne
+ def moveToFirst() = (size > 0) && (index != 0) && setTo(0)
+ def moveToLast() = (size > 0) && (index < lastIndex) && setTo(lastIndex)
+ def moveTo(idx: Int) = (idx > 0) && (idx <= lastIndex) && setTo(idx)
+ def moveToEnd(): Unit = setTo(size)
+
+ // scala legacy interface
+ def asList: List[JEntry] = toEntries().toList
+ def asJavaList = entries()
+ def asStrings = buf.toList
+ def grep(s: String) = buf.toList filter (_ contains s)
+}
diff --git a/src/compiler/scala/tools/nsc/interpreter/session/package.scala b/src/compiler/scala/tools/nsc/interpreter/session/package.scala
new file mode 100644
index 0000000000..e6ff2c3e03
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/interpreter/session/package.scala
@@ -0,0 +1,23 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Paul Phillips
+ */
+
+package scala.tools.nsc
+package interpreter
+
+/** Files having to do with the state of a repl session:
+ * lines of text entered, types and terms defined, etc.
+ */
+package object session {
+ type JIterator[T] = java.util.Iterator[T]
+ type JListIterator[T] = java.util.ListIterator[T]
+ type JList[T] = java.util.List[T]
+
+ type JEntry = scala.tools.jline.console.history.History.Entry
+ type JHistory = scala.tools.jline.console.history.History
+ type JMemoryHistory = scala.tools.jline.console.history.MemoryHistory
+ type JPersistentHistory = scala.tools.jline.console.history.PersistentHistory
+
+ private[interpreter] implicit def charSequenceFix(x: CharSequence): String = x.toString
+}
diff --git a/src/compiler/scala/tools/nsc/io/File.scala b/src/compiler/scala/tools/nsc/io/File.scala
index 5440abc0a0..d7967d5c07 100644
--- a/src/compiler/scala/tools/nsc/io/File.scala
+++ b/src/compiler/scala/tools/nsc/io/File.scala
@@ -22,9 +22,12 @@ object File {
def apply(path: Path)(implicit codec: Codec) = new File(path.jfile)(codec)
- // Create a temporary file
- def makeTemp(prefix: String = Path.randomPrefix, suffix: String = null, dir: JFile = null) =
- apply(JFile.createTempFile(prefix, suffix, dir))
+ // Create a temporary file, which will be deleted upon jvm exit.
+ def makeTemp(prefix: String = Path.randomPrefix, suffix: String = null, dir: JFile = null) = {
+ val jfile = JFile.createTempFile(prefix, suffix, dir)
+ jfile.deleteOnExit()
+ apply(jfile)
+ }
type HasClose = { def close(): Unit }
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 3539251a2c..2819d3f9ed 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -137,7 +137,7 @@ trait ScalaSettings extends AbsScalaSettings with StandardScalaSettings {
val Ytyperdebug = BooleanSetting ("-Ytyper-debug", "Trace all type assignements.")
val Ypmatdebug = BooleanSetting ("-Ypmat-debug", "Trace all pattern matcher activity.")
val Yrepldebug = BooleanSetting ("-Yrepl-debug", "Trace all repl activity.") .
- withPostSetHook(set => interpreter._debug = true)
+ withPostSetHook(set => interpreter.isReplDebug = true)
val Ycompletion = BooleanSetting ("-Ycompletion-debug", "Trace all tab completion activity.")
val Ypmatnaive = BooleanSetting ("-Ypmat-naive", "Desugar matches as naively as possible.")
val Ynotnull = BooleanSetting ("-Ynotnull", "Enable (experimental and incomplete) scala.NotNull.")