Skip to content

Commit 29d2d29

Browse files
oderskyDarkDimius
authored andcommitted
Fix for #55
Distringuish between ModifierFlags -- which can appear in trees -- and SourceModifierFlags -- which are modifiers according to the language spec.
1 parent 912b4bc commit 29d2d29

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/dotty/tools/dotc/core/Flags.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,14 @@ object Flags {
395395
// --------- Combined Flag Sets and Conjunctions ----------------------
396396

397397
/** Flags representing source modifiers */
398-
final val ModifierFlags =
398+
final val SourceModifierFlags =
399399
commonFlags(Private, Protected, Abstract, Final,
400400
Sealed, Case, Implicit, Override, AbsOverride, Lazy)
401401

402+
/** Flags representing modifiers that can appear in trees */
403+
final val ModifierFlags =
404+
SourceModifierFlags | Trait | Module | Param | Synthetic | Package
405+
402406
/** Flags representing access rights */
403407
final val AccessFlags = Private | Protected | Local
404408

src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
1515

1616
override protected def recursionLimitExceeded() = {}
1717

18-
protected val PrintableFlags = (ModifierFlags | Label | Module).toCommonFlags
18+
protected val PrintableFlags = (SourceModifierFlags | Label | Module).toCommonFlags
1919

2020
/** The closest enclosing DefDef, TypeDef, or ClassDef node */
2121
private var currentOwner: untpd.Tree = untpd.EmptyTree

0 commit comments

Comments
 (0)