@@ -279,7 +279,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
279279 }
280280
281281 protected def toTextCore [T >: Untyped ](tree : Tree [T ]): Text = {
282- import untpd .{ modsDeco => _ , _ }
282+ import untpd ._
283283
284284 def isLocalThis (tree : Tree ) = tree.typeOpt match {
285285 case tp : ThisType => tp.cls == ctx.owner.enclosingClass
@@ -647,7 +647,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
647647 }
648648
649649 override def toText [T >: Untyped ](tree : Tree [T ]): Text = controlled {
650- import untpd .{ modsDeco => _ , _ }
650+ import untpd ._
651651
652652 var txt = toTextCore(tree)
653653
@@ -722,11 +722,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
722722 }
723723 }
724724
725- /** Print modifiers from symbols if tree has type, overriding the untpd behavior. */
726- private implicit def modsDeco (mdef : untpd.DefTree ): untpd.ModsDecorator =
727- new untpd.ModsDecorator {
728- def mods = if (mdef.hasType) Modifiers (mdef.symbol) else mdef.rawMods
729- }
725+ /** Print modifiers from symbols if tree has type, overriding the behavior in Trees. */
726+ def (mdef : untpd.DefTree ).mods: untpd.Modifiers =
727+ if mdef.hasType then Modifiers (mdef.symbol) else mdef.rawMods
730728
731729 private def Modifiers (sym : Symbol ): Modifiers = untpd.Modifiers (
732730 sym.flags & (if (sym.isType) ModifierFlags | VarianceFlags else ModifierFlags ),
@@ -770,7 +768,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
770768 vparamss.foldLeft(leading)((txt, params) => txt ~ paramsText(params))
771769
772770 protected def valDefToText [T >: Untyped ](tree : ValDef [T ]): Text = {
773- import untpd .{ modsDeco => _ }
771+ import untpd ._
774772 dclTextOr(tree) {
775773 modText(tree.mods, tree.symbol, keywordStr(if (tree.mods.is(Mutable )) " var" else " val" ), isType = false ) ~~
776774 valDefText(nameIdText(tree)) ~ optAscription(tree.tpt) ~
@@ -784,7 +782,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
784782 ~ toText(params, " , " ) ~ " )"
785783
786784 protected def defDefToText [T >: Untyped ](tree : DefDef [T ]): Text = {
787- import untpd .{ modsDeco => _ }
785+ import untpd ._
788786 dclTextOr(tree) {
789787 val defKeyword = modText(tree.mods, tree.symbol, keywordStr(" def" ), isType = false )
790788 val isExtension = tree.hasType && tree.symbol.is(Extension )
0 commit comments