diff options
author | Martin Odersky <odersky@gmail.com> | 2016-11-04 16:44:06 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-11-24 16:54:24 +0100 |
commit | e6e47f195d5985b07934cdedb22680f767a6ecb5 (patch) | |
tree | 497668342691dd71dd740ab07ad8efb142f7d1e7 /compiler/src/dotty/tools/dotc/reporting/Reporter.scala | |
parent | 3588832eb3c45b151d78e66b5cde1f4e772d52a8 (diff) | |
download | dotty-e6e47f195d5985b07934cdedb22680f767a6ecb5.tar.gz dotty-e6e47f195d5985b07934cdedb22680f767a6ecb5.tar.bz2 dotty-e6e47f195d5985b07934cdedb22680f767a6ecb5.zip |
Better reporting of nested implicit failures
Error messages of nested implicit failures are now
reported with the top-level message if -explaintypes is set.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/reporting/Reporter.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala index 8477cfe28..26c1e5ebc 100644 --- a/compiler/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/compiler/src/dotty/tools/dotc/reporting/Reporter.scala @@ -286,11 +286,16 @@ abstract class Reporter extends interfaces.ReporterResult { } /** Should this diagnostic not be reported at all? */ - def isHidden(m: MessageContainer)(implicit ctx: Context): Boolean = ctx.mode.is(Mode.Printing) + def isHidden(m: MessageContainer)(implicit ctx: Context): Boolean = + ctx.mode.is(Mode.Printing) /** Does this reporter contain not yet reported errors or warnings? */ def hasPending: Boolean = false + /** If this reporter buffers messages, remove and return all buffered messages. */ + def removeBufferedMessages(implicit ctx: Context): List[MessageContainer] = Nil + /** Issue all error messages in this reporter to next outer one, or make sure they are written. */ - def flush()(implicit ctx: Context): Unit = {} + def flush()(implicit ctx: Context): Unit = + removeBufferedMessages.foreach(ctx.reporter.report) } |