@@ -277,7 +277,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
277
277
}
278
278
279
279
protected def toTextCore [T >: Untyped ](tree : Tree [T ]): Text = {
280
- import untpd .{ modsDeco => _ , _ }
280
+ import untpd ._
281
281
282
282
def isLocalThis (tree : Tree ) = tree.typeOpt match {
283
283
case tp : ThisType => tp.cls == ctx.owner.enclosingClass
@@ -645,7 +645,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
645
645
}
646
646
647
647
override def toText [T >: Untyped ](tree : Tree [T ]): Text = controlled {
648
- import untpd .{ modsDeco => _ , _ }
648
+ import untpd ._
649
649
650
650
var txt = toTextCore(tree)
651
651
@@ -720,11 +720,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
720
720
}
721
721
}
722
722
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
728
726
729
727
private def Modifiers (sym : Symbol ): Modifiers = untpd.Modifiers (
730
728
sym.flags & (if (sym.isType) ModifierFlags | VarianceFlags else ModifierFlags ),
@@ -768,7 +766,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
768
766
vparamss.foldLeft(leading)((txt, params) => txt ~ paramsText(params))
769
767
770
768
protected def valDefToText [T >: Untyped ](tree : ValDef [T ]): Text = {
771
- import untpd .{ modsDeco => _ }
769
+ import untpd ._
772
770
dclTextOr(tree) {
773
771
modText(tree.mods, tree.symbol, keywordStr(if (tree.mods.is(Mutable )) " var" else " val" ), isType = false ) ~~
774
772
valDefText(nameIdText(tree)) ~ optAscription(tree.tpt) ~
@@ -782,7 +780,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
782
780
~ toText(params, " , " ) ~ " )"
783
781
784
782
protected def defDefToText [T >: Untyped ](tree : DefDef [T ]): Text = {
785
- import untpd .{ modsDeco => _ }
783
+ import untpd ._
786
784
dclTextOr(tree) {
787
785
val defKeyword = modText(tree.mods, tree.symbol, keywordStr(" def" ), isType = false )
788
786
val isExtension = tree.hasType && tree.symbol.is(Extension )
0 commit comments