diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-26 19:15:40 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-03-29 09:29:05 +0100 |
commit | 37cf9efe509b0bac4fb6bda01b7126e7511e43f0 (patch) | |
tree | ee5fa94171acf87de4e5da5bf7ee704a18596163 /src/dotty/tools/dotc/reporting/Reporter.scala | |
parent | 0a1e969cb09e953d6b3f3b64b63a050588aa3360 (diff) | |
download | dotty-37cf9efe509b0bac4fb6bda01b7126e7511e43f0.tar.gz dotty-37cf9efe509b0bac4fb6bda01b7126e7511e43f0.tar.bz2 dotty-37cf9efe509b0bac4fb6bda01b7126e7511e43f0.zip |
Erasure phase PoC
Still missing: bridge method generation, signatures.
Other changes
- Turned around Checking and NoChecking. Checking is the default, NoChecking
disables it.
- Refactored Typer#typed to expose typedNamed, so that it can be overridden in
erasure.
- Made logging more forgiving wrt off-buy-one phase errors.
Conflicts:
src/dotty/tools/dotc/typer/Typer.scala
Diffstat (limited to 'src/dotty/tools/dotc/reporting/Reporter.scala')
-rw-r--r-- | src/dotty/tools/dotc/reporting/Reporter.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/reporting/Reporter.scala b/src/dotty/tools/dotc/reporting/Reporter.scala index e2b320588..933262861 100644 --- a/src/dotty/tools/dotc/reporting/Reporter.scala +++ b/src/dotty/tools/dotc/reporting/Reporter.scala @@ -106,8 +106,16 @@ trait Reporting { this: Context => def incompleteInputError(msg: String, pos: SourcePosition = NoSourcePosition)(implicit ctx: Context): Unit = reporter.incomplete(Diagnostic(msg, pos, ERROR))(ctx) + /** Log msg if current phase or its precedessor is mentioned in + * settings.log. + * The reason we also pick the predecessor is that during the + * tree transform of phase X, we often are already in phase X+1. + * It's convenient to have logging work independently of whether + * we have advanced the phase or not. + */ def log(msg: => String): Unit = - if (this.settings.log.value.containsPhase(phase)) + if (this.settings.log.value.containsPhase(phase) || + this.settings.log.value.containsPhase(phase.prev)) echo(s"[log ${ctx.phasesStack.reverse.mkString(" -> ")}] $msg") def debuglog(msg: => String): Unit = |