aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-27 18:55:50 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:11 +0200
commitea96ecda77ab99969a65b66173260e66b199be74 (patch)
tree18ee2854bc43b1d8ca55d117e74dfcd0350249b1 /compiler/src/dotty/tools/dotc/core
parent21ab9a1355036aa953db4e1f87c8f0f9a06506b5 (diff)
downloaddotty-ea96ecda77ab99969a65b66173260e66b199be74.tar.gz
dotty-ea96ecda77ab99969a65b66173260e66b199be74.tar.bz2
dotty-ea96ecda77ab99969a65b66173260e66b199be74.zip
Get rid of SuperAccessor flag
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Flags.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/core/unpickleScala2/PickleBuffer.scala2
-rw-r--r--compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala10
4 files changed, 11 insertions, 9 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala
index 8a1e14c63..ef3261719 100644
--- a/compiler/src/dotty/tools/dotc/core/Flags.scala
+++ b/compiler/src/dotty/tools/dotc/core/Flags.scala
@@ -311,12 +311,12 @@ object Flags {
final val CaseAccessorOrBaseTypeArg = CaseAccessor.toCommonFlags
/** A super accessor */
- final val SuperAccessor = termFlag(26, "<superaccessor>")
+ final val Scala2SuperAccessor = termFlag(26, "<superaccessor>")
/** An unpickled Scala 2.x class */
final val Scala2x = typeFlag(26, "<scala-2.x>")
- final val SuperAccessorOrScala2x = SuperAccessor.toCommonFlags
+ final val SuperAccessorOrScala2x = Scala2x.toCommonFlags
/** A method that has default params */
final val DefaultParameterized = termFlag(27, "<defaultparam>")
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index d8497f39d..8a9b68093 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -427,10 +427,8 @@ class TreeUnpickler(reader: TastyReader, nameAtRef: NameRef => TermName, posUnpi
val rhsIsEmpty = noRhs(end)
if (!rhsIsEmpty) skipTree()
val (givenFlags, annots, privateWithin) = readModifiers(end)
- val nameFlags =
- (if (name.is(NameExtractors.SuperAccessorName)) SuperAccessor else EmptyFlags)
pickling.println(i"creating symbol $name at $start with flags $givenFlags")
- val flags = normalizeFlags(tag, givenFlags | nameFlags, name, isAbsType, rhsIsEmpty)
+ val flags = normalizeFlags(tag, givenFlags, name, isAbsType, rhsIsEmpty)
def adjustIfModule(completer: LazyType) =
if (flags is Module) ctx.adjustModuleCompleter(completer, name) else completer
val sym =
diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/PickleBuffer.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/PickleBuffer.scala
index 773c6760e..2a789dca9 100644
--- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/PickleBuffer.scala
+++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/PickleBuffer.scala
@@ -224,7 +224,7 @@ object PickleBuffer {
DEFAULTPARAM -> (DefaultParameterized, Trait),
BRIDGE -> Bridge,
ACCESSOR -> Accessor,
- SUPERACCESSOR -> SuperAccessor,
+ SUPERACCESSOR -> Scala2SuperAccessor,
PARAMACCESSOR -> ParamAccessor,
MODULEVAR -> Scala2ModuleVar,
LAZY -> Lazy,
diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
index aed0e97f1..976eb5df4 100644
--- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
@@ -18,6 +18,7 @@ import printing.Printer
import io.AbstractFile
import util.common._
import typer.Checking.checkNonCyclic
+import transform.SymUtils._
import PickleBuffer._
import PickleFormat._
import Decorators._
@@ -441,7 +442,10 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
name = name.unmangleExpandedName
flags = flags &~ Scala2ExpandedName
}
- if (flags is SuperAccessor) name = name.asTermName.unmangleSuperName
+ if (flags is Scala2SuperAccessor) {
+ name = name.asTermName.unmangleSuperName
+ flags = flags &~ Scala2SuperAccessor
+ }
def isClassRoot = (name == classRoot.name) && (owner == classRoot.owner) && !(flags is ModuleClass)
def isModuleClassRoot = (name == moduleClassRoot.name) && (owner == moduleClassRoot.owner) && (flags is Module)
@@ -555,9 +559,9 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
else tp1
if (denot.isConstructor) addConstructorTypeParams(denot)
if (atEnd) {
- assert(!(denot is SuperAccessor), denot)
+ assert(!denot.isSuperAccessor, denot)
} else {
- assert(denot is (SuperAccessor | ParamAccessor), denot)
+ assert(denot.is(ParamAccessor) || denot.isSuperAccessor, denot)
def disambiguate(alt: Symbol) = { // !!! DEBUG
ctx.debugTraceIndented(s"disambiguating ${denot.info} =:= ${denot.owner.thisType.memberInfo(alt)} ${denot.owner}") {
denot.info matches denot.owner.thisType.memberInfo(alt)