From 0bd955e7780c95d41a0b6c4b7ca221f00e3cfd92 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 5 Sep 2016 11:48:31 +0200 Subject: Drop Inlined when homogenize Pickler drops Inlined nodes, so homogenize needs to do the same. --- src/dotty/tools/dotc/printing/RefinedPrinter.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/printing/RefinedPrinter.scala') 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) => -- cgit v1.2.3