Skip to content
Permalink
Browse files

Removing more unneeded code.

  • Loading branch information
paulp committed May 15, 2012
1 parent f865e3b commit 3e038d801cd3177ed1230eb7729e11f8743db23a
Showing with 128 additions and 1,432 deletions.
  1. +32 −63 src/compiler/scala/reflect/internal/HasFlags.scala
  2. +0 −112 src/compiler/scala/reflect/internal/SymbolCreations.scala
  3. +0 −77 src/compiler/scala/reflect/internal/SymbolFlags.scala
  4. +0 −2 src/compiler/scala/reflect/internal/SymbolTable.scala
  5. +75 −9 src/compiler/scala/reflect/internal/Symbols.scala
  6. +0 −27 src/compiler/scala/reflect/internal/TypeDebugging.scala
  7. +0 −12 src/compiler/scala/tools/nsc/Interpreter.scala
  8. +0 −12 src/compiler/scala/tools/nsc/InterpreterLoop.scala
  9. +0 −13 src/compiler/scala/tools/nsc/MainInterpreter.scala
  10. +3 −24 src/compiler/scala/tools/nsc/interpreter/AbstractFileClassLoader.scala
  11. +0 −23 src/compiler/scala/tools/nsc/interpreter/CodeHandlers.scala
  12. +0 −4 src/compiler/scala/tools/nsc/interpreter/Completion.scala
  13. +1 −58 src/compiler/scala/tools/nsc/interpreter/CompletionAware.scala
  14. +0 −33 src/compiler/scala/tools/nsc/interpreter/Eval.scala
  15. +0 −2 src/compiler/scala/tools/nsc/interpreter/ExprTyper.scala
  16. +0 −56 src/compiler/scala/tools/nsc/interpreter/FileCompletion.scala
  17. +6 −123 src/compiler/scala/tools/nsc/interpreter/ILoop.scala
  18. +0 −3 src/compiler/scala/tools/nsc/interpreter/IMain.scala
  19. +0 −1 src/compiler/scala/tools/nsc/interpreter/InteractiveReader.scala
  20. +1 −25 src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala
  21. +0 −3 src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
  22. +0 −39 src/compiler/scala/tools/nsc/interpreter/KeyBinding.scala
  23. +0 −44 src/compiler/scala/tools/nsc/interpreter/ProductCompletion.scala
  24. +0 −9 src/compiler/scala/tools/nsc/interpreter/ReplStrings.scala
  25. +0 −11 src/compiler/scala/tools/nsc/interpreter/Runner.scala
  26. +0 −1 src/compiler/scala/tools/nsc/interpreter/SimpleReader.scala
  27. +0 −44 src/compiler/scala/tools/nsc/interpreter/XMLCompletion.scala
  28. +0 −44 src/compiler/scala/tools/nsc/io/ClassAndJarInfo.scala
  29. +0 −5 src/compiler/scala/tools/nsc/package.scala
  30. +3 −3 src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
  31. +1 −82 src/compiler/scala/tools/nsc/util/ClassPath.scala
  32. +1 −22 src/compiler/scala/tools/nsc/util/ScalaClassLoader.scala
  33. +0 −38 src/library/scala/collection/interfaces/IterableMethods.scala
  34. +0 −45 src/library/scala/collection/interfaces/MapMethods.scala
  35. +0 −70 src/library/scala/collection/interfaces/SeqMethods.scala
  36. +0 −51 src/library/scala/collection/interfaces/SetMethods.scala
  37. +0 −63 src/library/scala/collection/interfaces/TraversableMethods.scala
  38. +0 −77 src/library/scala/collection/interfaces/TraversableOnceMethods.scala
  39. +1 −1 test/files/jvm/interpreter.scala
  40. +1 −1 test/files/run/repl-backticks.scala
  41. +0 −65 test/files/run/repl-suppressed-warnings.check
  42. +0 −32 test/files/run/repl-suppressed-warnings.scala
  43. +2 −2 test/files/run/t1500.scala
  44. +1 −1 test/files/run/t1501.scala
@@ -75,70 +75,41 @@ trait HasFlags {
* flag carrying entity.
*/
def resolveOverloadedFlag(flag: Long): String = Flags.flagToString(flag)

def privateWithinString = if (hasAccessBoundary) privateWithin.toString else ""

protected def isSetting(f: Long, mask: Long) = !hasFlag(f) && ((mask & f) != 0L)
protected def isClearing(f: Long, mask: Long) = hasFlag(f) && ((mask & f) != 0L)

// Tests which come through cleanly: both Symbol and Modifiers use these
// identically, testing for a single flag.
def isCase = hasFlag(CASE )
def isFinal = hasFlag(FINAL )
def isImplicit = hasFlag(IMPLICIT )
def isLazy = hasFlag(LAZY )
def isMutable = hasFlag(MUTABLE ) // in Modifiers, formerly isVariable
def isOverride = hasFlag(OVERRIDE )
def isPrivate = hasFlag(PRIVATE )
def isProtected = hasFlag(PROTECTED)
def isSynthetic = hasFlag(SYNTHETIC)
def isInterface = hasFlag(INTERFACE)

// Newly introduced based on having a reasonably obvious clean translation.
def isPrivateLocal = hasAllFlags(PrivateLocal)
def isProtectedLocal = hasAllFlags(ProtectedLocal)
def isParamAccessor = hasFlag(PARAMACCESSOR)
def isCaseAccessor = hasFlag(CASEACCESSOR)
def isSuperAccessor = hasFlag(SUPERACCESSOR)
def isLifted = hasFlag(LIFTED)

// Formerly the Modifiers impl did not include the access boundary check,
// which must have been a bug.
def isPublic = hasNoFlags(PRIVATE | PROTECTED) && !hasAccessBoundary

// Removed isClass qualification since the flag isn't overloaded and
// sym.isClass is enforced in Namers#validate.
def isSealed = hasFlag(SEALED)

// Removed !isClass qualification since the flag isn't overloaded.
def isDeferred = hasFlag(DEFERRED)

// Dropped isTerm condition because flag isn't overloaded.
def hasAbstractFlag = hasFlag(ABSTRACT)
def hasAccessorFlag = hasFlag(ACCESSOR)
def hasDefault = hasAllFlags(DEFAULTPARAM | PARAM)
def hasLocalFlag = hasFlag(LOCAL)
def hasModuleFlag = hasFlag(MODULE)
def hasPackageFlag = hasFlag(PACKAGE)
def hasStableFlag = hasFlag(STABLE)
def hasStaticFlag = hasFlag(STATIC)
def isAbstractOverride = hasFlag(ABSOVERRIDE)
def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE)

// Disambiguating: DEFAULTPARAM, TRAIT
def hasDefault = hasAllFlags(DEFAULTPARAM | PARAM)
def isTrait = hasFlag(TRAIT) && !hasFlag(PARAM)

// Straightforwardly named accessors already being used differently.
// These names are most likely temporary.
def hasAbstractFlag = hasFlag(ABSTRACT)
def hasAccessorFlag = hasFlag(ACCESSOR)
def hasLocalFlag = hasFlag(LOCAL)
def hasModuleFlag = hasFlag(MODULE)
def hasPackageFlag = hasFlag(PACKAGE)
def hasStableFlag = hasFlag(STABLE)
def hasStaticFlag = hasFlag(STATIC)

// Disambiguating: LABEL, CONTRAVARIANT, INCONSTRUCTOR
def isLabel = hasAllFlags(LABEL | METHOD) && !hasAccessorFlag
// Cannot effectively disambiguate the others at this level.
def hasContravariantFlag = hasFlag(CONTRAVARIANT)
def hasInConstructorFlag = hasFlag(INCONSTRUCTOR)

// Name
def isJavaDefined = hasFlag(JAVA)
def isAnyOverride = hasFlag(OVERRIDE | ABSOVERRIDE)
def isCase = hasFlag(CASE)
def isCaseAccessor = hasFlag(CASEACCESSOR)
def isDeferred = hasFlag(DEFERRED)
def isFinal = hasFlag(FINAL)
def isImplicit = hasFlag(IMPLICIT)
def isInterface = hasFlag(INTERFACE)
def isJavaDefined = hasFlag(JAVA)
def isLabel = hasAllFlags(LABEL | METHOD) && !hasAccessorFlag
def isLazy = hasFlag(LAZY)
def isLifted = hasFlag(LIFTED)
def isMutable = hasFlag(MUTABLE)
def isOverride = hasFlag(OVERRIDE)
def isParamAccessor = hasFlag(PARAMACCESSOR)
def isPrivate = hasFlag(PRIVATE)
def isPrivateLocal = hasAllFlags(PrivateLocal)
def isProtected = hasFlag(PROTECTED)
def isProtectedLocal = hasAllFlags(ProtectedLocal)
def isPublic = hasNoFlags(PRIVATE | PROTECTED) && !hasAccessBoundary
def isSealed = hasFlag(SEALED)
def isSuperAccessor = hasFlag(SUPERACCESSOR)
def isSynthetic = hasFlag(SYNTHETIC)
def isTrait = hasFlag(TRAIT) && !hasFlag(PARAM)

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

def accessString: String = {
val pw = privateWithinString
val pw = if (hasAccessBoundary) privateWithin.toString else ""

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

This file was deleted.

This file was deleted.

@@ -13,9 +13,7 @@ import scala.tools.nsc.util.WeakHashSet
abstract class SymbolTable extends api.Universe
with Collections
with Names
with SymbolCreations
with Symbols
with SymbolFlags
with FreeVars
with Types
with Kinds

0 comments on commit 3e038d8

Please sign in to comment.
You can’t perform that action at this time.