diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-05 11:48:31 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | 0bd955e7780c95d41a0b6c4b7ca221f00e3cfd92 (patch) | |
tree | 2deaa4b38da4b3930004c2ade4d8f0fa798c0ef8 /src | |
parent | 7cce2d463a001f5f5660a391a71bddd2cde1a15f (diff) | |
download | dotty-0bd955e7780c95d41a0b6c4b7ca221f00e3cfd92.tar.gz dotty-0bd955e7780c95d41a0b6c4b7ca221f00e3cfd92.tar.bz2 dotty-0bd955e7780c95d41a0b6c4b7ca221f00e3cfd92.zip |
Drop Inlined when homogenize
Pickler drops Inlined nodes, so homogenize needs to do the same.
Diffstat (limited to 'src')
-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 53d9750f8..fd79b8c50 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -7,7 +7,7 @@ import TypeErasure.ErasedValueType import Contexts.Context, Scopes.Scope, Denotations._, SymDenotations._, Annotations.Annotation import StdNames.{nme, tpnme} import ast.{Trees, untpd, tpd} -import typer.Namer +import typer.{Namer, Inliner} import typer.ProtoTypes.{SelectionProto, ViewProto, FunProto, IgnoredProto, dummyTreeOfType} import Trees._ import TypeApplications._ @@ -36,6 +36,11 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { } } + def homogenize(tree: Tree[_])(implicit ctx: Context) = tree match { + case tree: tpd.Inlined => Inliner.dropInlined(tree) + case _ => tree + } + private def enclDefIsClass = enclosingDef match { case owner: TypeDef[_] => owner.isClassDef case owner: untpd.ModuleDef => true @@ -277,7 +282,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { if (homogenizedView && pid.hasType) toTextLocal(pid.tpe) else toTextLocal(pid) - var txt: Text = tree match { + var txt: Text = homogenize(tree) match { case id: Trees.BackquotedIdent[_] if !homogenizedView => "`" ~ toText(id.name) ~ "`" case Ident(name) => |