diff options
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Flags.scala | 17 | ||||
-rw-r--r-- | src/dotty/tools/dotc/printing/RefinedPrinter.scala | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala index 40da7525d..07259276e 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -102,8 +102,16 @@ object Flags { } /** The list of non-empty names of flags that are set in this FlagSet */ - def flagStrings: Seq[String] = - (2 to MaxFlag).flatMap(flagString) + def flagStrings: Seq[String] = { + val rawStrings = (2 to MaxFlag).flatMap(flagString) + if (this is Local) + rawStrings.filter(_ != "<local>").map { + case "private" => "private[this]" + case "protected" => "protected[this]" + case str => str + } + else rawStrings + } /** The string representation of this flag set */ override def toString = flagStrings.mkString(" ") @@ -405,7 +413,10 @@ object Flags { /** Flags representing modifiers that can appear in trees */ final val ModifierFlags = - SourceModifierFlags | Trait | Module | Param | Synthetic | Package + SourceModifierFlags | Module | Param | Synthetic | Package | Local + // | Trait is subsumed by commonFlags(Lazy) from SourceModifierFlags + + assert(ModifierFlags.isTermFlags && ModifierFlags.isTypeFlags) /** Flags representing access rights */ final val AccessFlags = Private | Protected | Local diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 385b407b5..a327b4e3e 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -15,7 +15,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { override protected def recursionLimitExceeded() = {} - protected val PrintableFlags = (SourceModifierFlags | Label | Module).toCommonFlags + protected val PrintableFlags = (SourceModifierFlags | Label | Module | Local).toCommonFlags /** The closest enclosing DefDef, TypeDef, or ClassDef node */ private var currentOwner: untpd.Tree = untpd.EmptyTree |