diff options
author | Martin Odersky <odersky@gmail.com> | 2014-04-04 09:51:41 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-04-08 16:56:04 +0200 |
commit | f573a56ddc2b4f3c55c3ce1d92903a239896b950 (patch) | |
tree | 0cc02532a4ee13ed215ca1a8b47237fb7901c8bc /src/dotty/tools/dotc/printing/RefinedPrinter.scala | |
parent | dd5341106d9b57a99316a26a1f0c7e195b6debf1 (diff) | |
download | dotty-f573a56ddc2b4f3c55c3ce1d92903a239896b950.tar.gz dotty-f573a56ddc2b4f3c55c3ce1d92903a239896b950.tar.bz2 dotty-f573a56ddc2b4f3c55c3ce1d92903a239896b950.zip |
Better printing of denotations.
Used to print <none> for denotations with a symbol,
now prints "some I" where I is the denotation's info.Reworked phases.
Diffstat (limited to 'src/dotty/tools/dotc/printing/RefinedPrinter.scala')
-rw-r--r-- | src/dotty/tools/dotc/printing/RefinedPrinter.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 557a2b5db..f9cd9ec72 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -3,7 +3,7 @@ package printing import core._ import Texts._, Types._, Flags._, Names._, Symbols._, NameOps._, Constants._ -import Contexts.Context, Scopes.Scope, Denotations.Denotation, Annotations.Annotation +import Contexts.Context, Scopes.Scope, Denotations._, Annotations.Annotation import StdNames.nme import ast.{Trees, untpd} import typer.Namer @@ -475,7 +475,12 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { Text(flags.flagStrings.filterNot(_.startsWith("<")) map stringToText, " ") } - override def toText(denot: Denotation): Text = toText(denot.symbol) + override def toText(denot: Denotation): Text = denot match { + case denot: MultiDenotation => denot.toString + case _ => + if (denot.symbol.exists) toText(denot.symbol) + else "some " ~ toText(denot.info) + } override def plain = new PlainPrinter(_ctx) } |