Skip to content

Commit 8cabda8

Browse files
committed
Merge pull request scala#1116 from scalamacros/topic/flags-again
a follow up on e01ec05
2 parents 4459e5a + 79b0da9 commit 8cabda8

File tree

6 files changed

+7
-13
lines changed

6 files changed

+7
-13
lines changed

src/library/scala/reflect/base/Base.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ class Base extends Universe { self =>
233233

234234
class Modifiers(override val flags: FlagSet,
235235
override val privateWithin: Name,
236-
override val annotations: List[Tree]) extends ModifiersBase
236+
override val annotations: List[Tree]) extends ModifiersBase {
237+
def hasFlag(flags: FlagSet) = (this.flags & flags) != 0
238+
}
237239

238240
implicit val ModifiersTag = ClassTag[Modifiers](classOf[Modifiers])
239241

src/library/scala/reflect/base/FlagSets.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,4 @@ trait FlagSets { self: Universe =>
1313

1414
/** The empty set of flags */
1515
val NoFlags: FlagSet
16-
17-
/** The base API all flag bearers support */
18-
trait HasFlagsBase {
19-
def flags: FlagSet
20-
}
2116
}
22-

src/library/scala/reflect/base/Trees.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,9 @@ trait Trees { self: Universe =>
13591359
implicit val ModifiersTag: ClassTag[Modifiers]
13601360

13611361
/** ... */
1362-
abstract class ModifiersBase extends HasFlagsBase {
1362+
abstract class ModifiersBase {
1363+
def flags: FlagSet // default: NoFlags
1364+
def hasFlag(flag: FlagSet): Boolean
13631365
def privateWithin: Name // default: EmptyTypeName
13641366
def annotations: List[Tree] // default: List()
13651367
def mapAnnotations(f: List[Tree] => List[Tree]): Modifiers =

src/reflect/scala/reflect/api/Symbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait Symbols extends base.Symbols { self: Universe =>
1313
override type FreeTypeSymbol >: Null <: TypeSymbol with FreeTypeSymbolApi
1414

1515
/** The API of symbols */
16-
trait SymbolApi extends SymbolBase with HasFlagsBase { this: Symbol =>
16+
trait SymbolApi extends SymbolBase { this: Symbol =>
1717

1818
/** The position of this symbol
1919
*/

src/reflect/scala/reflect/internal/Symbols.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
8080
def toType: Type = tpe
8181
def toTypeIn(site: Type): Type = site.memberType(this)
8282
def toTypeConstructor: Type = typeConstructor
83-
def setFlags(flags: FlagSet): this.type = setInternalFlags(flags)
84-
def setInternalFlags(flag: Long): this.type = { setFlag(flag); this }
8583
def setTypeSignature(tpe: Type): this.type = { setInfo(tpe); this }
8684
def getAnnotations: List[AnnotationInfo] = { initialize; annotations }
8785
def setAnnotations(annots: AnnotationInfo*): this.type = { setAnnotations(annots.toList); this }

src/reflect/scala/reflect/macros/Universe.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ abstract class Universe extends scala.reflect.api.Universe {
2424
*/
2525
trait SymbolContextApi extends SymbolApi with AttachableApi { self: Symbol =>
2626

27-
def setFlags(flags: FlagSet): Symbol
28-
2927
def setTypeSignature(tpe: Type): Symbol
3028

3129
def setAnnotations(annots: AnnotationInfo*): Symbol

0 commit comments

Comments
 (0)