Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 3e038d8

Browse files
committed
Removing more unneeded code.
1 parent f865e3b commit 3e038d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+128
-1432
lines changed

src/compiler/scala/reflect/internal/HasFlags.scala

Lines changed: 32 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -75,70 +75,41 @@ trait HasFlags {
7575
* flag carrying entity.
7676
*/
7777
def resolveOverloadedFlag(flag: Long): String = Flags.flagToString(flag)
78-
79-
def privateWithinString = if (hasAccessBoundary) privateWithin.toString else ""
80-
81-
protected def isSetting(f: Long, mask: Long) = !hasFlag(f) && ((mask & f) != 0L)
82-
protected def isClearing(f: Long, mask: Long) = hasFlag(f) && ((mask & f) != 0L)
8378

8479
// Tests which come through cleanly: both Symbol and Modifiers use these
8580
// identically, testing for a single flag.
86-
def isCase = hasFlag(CASE )
87-
def isFinal = hasFlag(FINAL )
88-
def isImplicit = hasFlag(IMPLICIT )
89-
def isLazy = hasFlag(LAZY )
90-
def isMutable = hasFlag(MUTABLE ) // in Modifiers, formerly isVariable
91-
def isOverride = hasFlag(OVERRIDE )
92-
def isPrivate = hasFlag(PRIVATE )
93-
def isProtected = hasFlag(PROTECTED)
94-
def isSynthetic = hasFlag(SYNTHETIC)
95-
def isInterface = hasFlag(INTERFACE)
96-
97-
// Newly introduced based on having a reasonably obvious clean translation.
98-
def isPrivateLocal = hasAllFlags(PrivateLocal)
99-
def isProtectedLocal = hasAllFlags(ProtectedLocal)
100-
def isParamAccessor = hasFlag(PARAMACCESSOR)
101-
def isCaseAccessor = hasFlag(CASEACCESSOR)
102-
def isSuperAccessor = hasFlag(SUPERACCESSOR)
103-
def isLifted = hasFlag(LIFTED)
104-
105-
// Formerly the Modifiers impl did not include the access boundary check,
106-
// which must have been a bug.
107-
def isPublic = hasNoFlags(PRIVATE | PROTECTED) && !hasAccessBoundary
108-
109-
// Removed isClass qualification since the flag isn't overloaded and
110-
// sym.isClass is enforced in Namers#validate.
111-
def isSealed = hasFlag(SEALED)
112-
113-
// Removed !isClass qualification since the flag isn't overloaded.
114-
def isDeferred = hasFlag(DEFERRED)
115-
116-
// Dropped isTerm condition because flag isn't overloaded.
81+
def hasAbstractFlag = hasFlag(ABSTRACT)
82+
def hasAccessorFlag = hasFlag(ACCESSOR)
83+
def hasDefault = hasAllFlags(DEFAULTPARAM | PARAM)
84+
def hasLocalFlag = hasFlag(LOCAL)
85+
def hasModuleFlag = hasFlag(MODULE)
86+
def hasPackageFlag = hasFlag(PACKAGE)
87+
def hasStableFlag = hasFlag(STABLE)
88+
def hasStaticFlag = hasFlag(STATIC)
11789
def isAbstractOverride = hasFlag(ABSOVERRIDE)
118-
def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE)
119-
120-
// Disambiguating: DEFAULTPARAM, TRAIT
121-
def hasDefault = hasAllFlags(DEFAULTPARAM | PARAM)
122-
def isTrait = hasFlag(TRAIT) && !hasFlag(PARAM)
123-
124-
// Straightforwardly named accessors already being used differently.
125-
// These names are most likely temporary.
126-
def hasAbstractFlag = hasFlag(ABSTRACT)
127-
def hasAccessorFlag = hasFlag(ACCESSOR)
128-
def hasLocalFlag = hasFlag(LOCAL)
129-
def hasModuleFlag = hasFlag(MODULE)
130-
def hasPackageFlag = hasFlag(PACKAGE)
131-
def hasStableFlag = hasFlag(STABLE)
132-
def hasStaticFlag = hasFlag(STATIC)
133-
134-
// Disambiguating: LABEL, CONTRAVARIANT, INCONSTRUCTOR
135-
def isLabel = hasAllFlags(LABEL | METHOD) && !hasAccessorFlag
136-
// Cannot effectively disambiguate the others at this level.
137-
def hasContravariantFlag = hasFlag(CONTRAVARIANT)
138-
def hasInConstructorFlag = hasFlag(INCONSTRUCTOR)
139-
140-
// Name
141-
def isJavaDefined = hasFlag(JAVA)
90+
def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE)
91+
def isCase = hasFlag(CASE)
92+
def isCaseAccessor = hasFlag(CASEACCESSOR)
93+
def isDeferred = hasFlag(DEFERRED)
94+
def isFinal = hasFlag(FINAL)
95+
def isImplicit = hasFlag(IMPLICIT)
96+
def isInterface = hasFlag(INTERFACE)
97+
def isJavaDefined = hasFlag(JAVA)
98+
def isLabel = hasAllFlags(LABEL | METHOD) && !hasAccessorFlag
99+
def isLazy = hasFlag(LAZY)
100+
def isLifted = hasFlag(LIFTED)
101+
def isMutable = hasFlag(MUTABLE)
102+
def isOverride = hasFlag(OVERRIDE)
103+
def isParamAccessor = hasFlag(PARAMACCESSOR)
104+
def isPrivate = hasFlag(PRIVATE)
105+
def isPrivateLocal = hasAllFlags(PrivateLocal)
106+
def isProtected = hasFlag(PROTECTED)
107+
def isProtectedLocal = hasAllFlags(ProtectedLocal)
108+
def isPublic = hasNoFlags(PRIVATE | PROTECTED) && !hasAccessBoundary
109+
def isSealed = hasFlag(SEALED)
110+
def isSuperAccessor = hasFlag(SUPERACCESSOR)
111+
def isSynthetic = hasFlag(SYNTHETIC)
112+
def isTrait = hasFlag(TRAIT) && !hasFlag(PARAM)
142113

143114
def flagBitsToString(bits: Long): String = {
144115
// Fast path for common case
@@ -162,7 +133,7 @@ trait HasFlags {
162133
}
163134

164135
def accessString: String = {
165-
val pw = privateWithinString
136+
val pw = if (hasAccessBoundary) privateWithin.toString else ""
166137

167138
if (pw == "") {
168139
if (hasAllFlags(PrivateLocal)) "private[this]"
@@ -188,8 +159,6 @@ trait HasFlags {
188159
def hasTraitFlag = hasFlag(TRAIT)
189160
@deprecated("Use hasDefault", "2.10.0")
190161
def hasDefaultFlag = hasFlag(DEFAULTPARAM)
191-
@deprecated("", "2.9.0")
192-
def isAbstract = hasFlag(ABSTRACT)
193162
@deprecated("Use isValueParameter or isTypeParameter", "2.10.0")
194163
def isParameter = hasFlag(PARAM)
195164
@deprecated("Use flagString", "2.10.0")

src/compiler/scala/reflect/internal/SymbolCreations.scala

Lines changed: 0 additions & 112 deletions
This file was deleted.

src/compiler/scala/reflect/internal/SymbolFlags.scala

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/compiler/scala/reflect/internal/SymbolTable.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import scala.tools.nsc.util.WeakHashSet
1313
abstract class SymbolTable extends api.Universe
1414
with Collections
1515
with Names
16-
with SymbolCreations
1716
with Symbols
18-
with SymbolFlags
1917
with FreeVars
2018
with Types
2119
with Kinds

0 commit comments

Comments
 (0)