Skip to content

Commit d6cdcee

Browse files
committed
Address review comments
1 parent 3617ca6 commit d6cdcee

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

compiler/src/dotty/tools/dotc/reporting/Reporter.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object Reporter {
2424
}
2525
}
2626

27-
/** A reporter that ignores reports */
27+
/** A reporter that ignores reports, and doesn't record errors */
2828
@sharable object NoReporter extends Reporter {
2929
def doReport(m: MessageContainer)(implicit ctx: Context) = ()
3030
override def report(m: MessageContainer)(implicit ctx: Context): Unit = ()
@@ -163,8 +163,10 @@ abstract class Reporter extends interfaces.ReporterResult {
163163
finally incompleteHandler = saved
164164
}
165165

166-
var errorCount = 0
167-
var warningCount = 0
166+
private[this] var _errorCount = 0
167+
private[this] var _warningCount = 0
168+
def errorCount = _errorCount
169+
def warningCount = _warningCount
168170
def hasErrors = errorCount > 0
169171
def hasWarnings = warningCount > 0
170172
private[this] var errors: List[Error] = Nil
@@ -191,10 +193,10 @@ abstract class Reporter extends interfaces.ReporterResult {
191193
doReport(m)(ctx.addMode(Mode.Printing))
192194
m match {
193195
case m: ConditionalWarning if !m.enablingOption.value => unreportedWarnings(m.enablingOption.name) += 1
194-
case m: Warning => warningCount += 1
196+
case m: Warning => _warningCount += 1
195197
case m: Error =>
196198
errors = m :: errors
197-
errorCount += 1
199+
_errorCount += 1
198200
case m: Info => // nothing to do here
199201
// match error if d is something else
200202
}

compiler/src/dotty/tools/repl/JLineTerminal.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ final class JLineTerminal extends java.io.Closeable {
5050
.completer(completer)
5151
.highlighter(new Highlighter)
5252
.parser(new Parser)
53-
.variable(SECONDARY_PROMPT_PATTERN, "%M")
53+
.variable(SECONDARY_PROMPT_PATTERN, "%M") // A short word explaining what is "missing".
54+
// This is supplied from the EOFError.getMissing() method
5455
.variable(LIST_MAX, 400) // ask user when number of completions exceed this limit (default is 100)
5556
.option(INSERT_TAB, true) // at the beginning of the line, insert tab instead of completing
5657
.option(AUTO_FRESH_LINE, true) // if not at start of line before prompt, move to new line

0 commit comments

Comments
 (0)