diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-16 11:23:50 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-21 17:41:13 +0200 |
commit | 9ab86534d7225edcafd3e16849b638c1d99aea69 (patch) | |
tree | 07d7e709c77f878442e7c1d3bda7f0189296db9d /src/dotty/tools/dotc/printing/PlainPrinter.scala | |
parent | 3d9d90e1a29a80f9df968a0e53e01ecb31c397c7 (diff) | |
download | dotty-9ab86534d7225edcafd3e16849b638c1d99aea69.tar.gz dotty-9ab86534d7225edcafd3e16849b638c1d99aea69.tar.bz2 dotty-9ab86534d7225edcafd3e16849b638c1d99aea69.zip |
Add "Printing" mode
Idea: when printing, we should be more lenient about conditions that
would otherwise cause an assertion failure, because we want to avoid
triggering further assertions while diagnosing previous errors. As a start
we generalize an assertion that RefinedTypes cannot be created after erasure.
This gets triggered when playing around with printing lambdas at erasure time
(see following commit): erasure runs at phase erasure + 1, so ctx.erasedTypes is true,
but we might still want to print lambdas then, and printing lambdas will create new
refined types as of next commit.
Diffstat (limited to 'src/dotty/tools/dotc/printing/PlainPrinter.scala')
-rw-r--r-- | src/dotty/tools/dotc/printing/PlainPrinter.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index fb1c0fc74..9e4c43fec 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -8,10 +8,11 @@ import StdNames.nme import ast.Trees._, ast._ import java.lang.Integer.toOctalString import config.Config.summarizeDepth +import typer.Mode import scala.annotation.switch class PlainPrinter(_ctx: Context) extends Printer { - protected[this] implicit def ctx: Context = _ctx + protected[this] implicit def ctx: Context = _ctx.fresh.addMode(Mode.Printing) protected def maxToTextRecursions = 100 |