diff options
author | Paul Phillips <paulp@improving.org> | 2009-04-22 17:38:53 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-04-22 17:38:53 +0000 |
commit | c52b5c7df7b3274ce7e72dee7ef416edb037cff5 (patch) | |
tree | ab866e225c157ccab8b1c864d899023a3fb96789 /src/compiler | |
parent | d1d54c6f8d616b13bca6c6a5bf91ae46f119e0d1 (diff) | |
download | scala-c52b5c7df7b3274ce7e72dee7ef416edb037cff5.tar.gz scala-c52b5c7df7b3274ce7e72dee7ef416edb037cff5.tar.bz2 scala-c52b5c7df7b3274ce7e72dee7ef416edb037cff5.zip |
Changed Flags object not to inherit from Enumer...
Changed Flags object not to inherit from Enumeration; removed unused
enumeration classes; fixed three other bugs which were being masked by
all the bonus symbols in Flags.
Diffstat (limited to 'src/compiler')
4 files changed, 6 insertions, 36 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Flags.scala b/src/compiler/scala/tools/nsc/symtab/Flags.scala index 530bca7496..654c96a94f 100644 --- a/src/compiler/scala/tools/nsc/symtab/Flags.scala +++ b/src/compiler/scala/tools/nsc/symtab/Flags.scala @@ -6,7 +6,7 @@ package scala.tools.nsc.symtab -object Flags extends Enumeration { +object Flags { // modifiers final val IMPLICIT = 0x00000200 @@ -104,7 +104,6 @@ object Flags extends Enumeration { final val notOVERRIDE = (OVERRIDE: Long) << AntiShift final val notMETHOD = (METHOD: Long) << AntiShift - // The flags from 0x001 to 0x800 are different in the raw flags // and in the pickled format. @@ -330,36 +329,4 @@ object Flags extends Enumeration { def isVariable = (mods & MUTABLE) != 0 def isPublic = !isPrivate && !isProtected } - case class FlagEnum(mask: Long) extends Val(maskToBit(mask), flagToString(mask)) - - val Implicit = FlagEnum(IMPLICIT) - val Final = FlagEnum(FINAL) - val Private = FlagEnum(PRIVATE) - val Protected = FlagEnum(PROTECTED) - val Sealed = FlagEnum(SEALED) - val Override = FlagEnum(OVERRIDE) - val Case = FlagEnum(CASE) - val Abstract = FlagEnum(ABSTRACT) - val Deferred = FlagEnum(DEFERRED) - val Method = FlagEnum(METHOD) - val Module = FlagEnum(MODULE) - val Interface = FlagEnum(INTERFACE) - val Mutable = FlagEnum(MUTABLE) - val Param = FlagEnum(PARAM) - val Package = FlagEnum(PACKAGE) - val Deprecated = FlagEnum(DEPRECATED) - val Covariant = FlagEnum(COVARIANT) - val Contravariant = FlagEnum(CONTRAVARIANT) - val AbsOverride = FlagEnum(ABSOVERRIDE) - val Local = FlagEnum(LOCAL) - val Synthetic = FlagEnum(SYNTHETIC) - val Stable = FlagEnum(STABLE) - val CaseAccessor = FlagEnum(CASEACCESSOR) - val Trait = FlagEnum(TRAIT) - val Bridge = FlagEnum(BRIDGE) - val Accessor = FlagEnum(ACCESSOR) - val SuperAccessor = FlagEnum(SUPERACCESSOR) - val ParamAccessor = FlagEnum(PARAMACCESSOR) - val ModuleVar = FlagEnum(MODULEVAR) - } diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala index d6ae26a417..17cc7dab44 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala @@ -166,7 +166,7 @@ abstract class SymbolLoaders { def refresh() { /** Is the given name a valid input file base name? */ def isValid(name: String): Boolean = - name.length() > 0 && !name.endsWith("$class") + name.length() > 0 && !name.endsWith("$class") && (/*settings.XO.value*/true || name.indexOf("$anon") == -1) val classes = new HashMap[String, global.classPath0.Context] @@ -195,7 +195,7 @@ abstract class SymbolLoaders { if (file.isDirectory && directory.validPackage(file.name) && !packages.isDefinedAt(file.name)) packages(file.name) = directory.find(file.name, true) else if (dir.source.compile) - recordClass(file, ".scala", source => checkSource(name, source.sourceFile)) + recordClass(file, ".scala", source => checkSource(file.name, source.sourceFile)) } } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index f69aaa765a..7a721c52de 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -240,6 +240,7 @@ abstract class Pickler extends SubComponent { case LabelDef(name, params, rhs) => + putEntry(name) putTree(rhs) putTrees(params) @@ -644,6 +645,7 @@ abstract class Pickler extends SubComponent { writeNat(LABELtree) writeRef(tree.tpe) writeRef(tree.symbol) + writeRef(name) writeRef(rhs) writeRefs(params) TREE diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala index 57e86892fd..0b76104433 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala @@ -478,6 +478,7 @@ abstract class UnPickler { case LABELtree => val symbol = readSymbolRef() + val name = readNameRef() val rhs = readTreeRef() val params = until(end, readIdentRef) (LabelDef(name, params, rhs). |