@@ -277,7 +277,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
277277 }
278278
279279 protected def toTextCore [T >: Untyped ](tree : Tree [T ]): Text = {
280- import untpd .{ modsDeco => _ , _ }
280+ import untpd ._
281281
282282 def isLocalThis (tree : Tree ) = tree.typeOpt match {
283283 case tp : ThisType => tp.cls == ctx.owner.enclosingClass
@@ -645,7 +645,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
645645 }
646646
647647 override def toText [T >: Untyped ](tree : Tree [T ]): Text = controlled {
648- import untpd .{ modsDeco => _ , _ }
648+ import untpd ._
649649
650650 var txt = toTextCore(tree)
651651
@@ -720,11 +720,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
720720 }
721721 }
722722
723- /** Print modifiers from symbols if tree has type, overriding the untpd behavior. */
724- private implicit def modsDeco (mdef : untpd.DefTree ): untpd.ModsDecorator =
725- new untpd.ModsDecorator {
726- def mods = if (mdef.hasType) Modifiers (mdef.symbol) else mdef.rawMods
727- }
723+ /** Print modifiers from symbols if tree has type, overriding the behavior in Trees. */
724+ def (mdef : untpd.DefTree ).mods: untpd.Modifiers =
725+ if mdef.hasType then Modifiers (mdef.symbol) else mdef.rawMods
728726
729727 private def Modifiers (sym : Symbol ): Modifiers = untpd.Modifiers (
730728 sym.flags & (if (sym.isType) ModifierFlags | VarianceFlags else ModifierFlags ),
@@ -768,7 +766,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
768766 vparamss.foldLeft(leading)((txt, params) => txt ~ paramsText(params))
769767
770768 protected def valDefToText [T >: Untyped ](tree : ValDef [T ]): Text = {
771- import untpd .{ modsDeco => _ }
769+ import untpd ._
772770 dclTextOr(tree) {
773771 modText(tree.mods, tree.symbol, keywordStr(if (tree.mods.is(Mutable )) " var" else " val" ), isType = false ) ~~
774772 valDefText(nameIdText(tree)) ~ optAscription(tree.tpt) ~
@@ -782,7 +780,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
782780 ~ toText(params, " , " ) ~ " )"
783781
784782 protected def defDefToText [T >: Untyped ](tree : DefDef [T ]): Text = {
785- import untpd .{ modsDeco => _ }
783+ import untpd ._
786784 dclTextOr(tree) {
787785 val defKeyword = modText(tree.mods, tree.symbol, keywordStr(" def" ), isType = false )
788786 val isExtension = tree.hasType && tree.symbol.is(Extension )
0 commit comments