Skip to content

Commit

Permalink
REPL summarizes warnings
Browse files Browse the repository at this point in the history
Emit the summary after successful parse in case
"there were deprecations".
  • Loading branch information
som-snytt committed Feb 1, 2020
1 parent 46a8156 commit af2347c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/repl/scala/tools/nsc/interpreter/IMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ class IMain(val settings: Settings, parentClassLoaderOverride: Option[ClassLoade
case _ => Nil
}


/** The path of the value that contains the user code. */
def fullAccessPath = s"${lineRep.readPathInstance}$accessPath"

Expand Down Expand Up @@ -1128,12 +1127,11 @@ class IMain(val settings: Settings, parentClassLoaderOverride: Option[ClassLoade
reporter.reset()
val unit = newCompilationUnit(line, label)
val trees = newUnitParser(unit).parseStats()
if (reporter.hasErrors) Left(Error)
else if (reporter.hasWarnings && settings.fatalWarnings) {
if (!isIncomplete)
currentRun.reporting.summarizeErrors()
Left(Error)
}
if (reporter.hasErrors) Left(Error)
else if (isIncomplete) Left(Incomplete)
else if (reporter.hasWarnings && settings.fatalWarnings) Left(Error)
else Right((trees, unit.firstXmlPos))
}
}
Expand Down

0 comments on commit af2347c

Please sign in to comment.