aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/UnPickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-03 16:10:21 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-03 16:10:21 +0100
commita1049e6227d412ce6bdd9065a350cb20921987e2 (patch)
tree506849218a5178916e6fa87e0d0f0636e50e4434 /src/dotty/tools/dotc/core/pickling/UnPickler.scala
parent30bfa5b1be62652fc07292d36ed1261edbcdb362 (diff)
downloaddotty-a1049e6227d412ce6bdd9065a350cb20921987e2.tar.gz
dotty-a1049e6227d412ce6bdd9065a350cb20921987e2.tar.bz2
dotty-a1049e6227d412ce6bdd9065a350cb20921987e2.zip
Split scopes into immutable and mutable parts.
The goal is that symbols should be entered/deleted directly into classes instead of their scopes. This is necesaary so that invariant about fingerPrint can be maintained. We achieve it by making the info scope have immutable type, so an explicit cast is needed to get around that.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index 9edc8cb84..55ed9b63d 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -24,7 +24,7 @@ object UnPickler {
case class TempPolyType(tparams: List[Symbol], tpe: Type) extends UncachedGroundType
/** Temporary type for classinfos, will be decomposed on completion of the class */
- case class TempClassInfoType(parentTypes: List[Type], decls: Scope, clazz: Symbol) extends UncachedGroundType
+ case class TempClassInfoType(parentTypes: List[Type], decls: MutableScope, clazz: Symbol) extends UncachedGroundType
def depoly(tp: Type)(implicit ctx: Context): Type = tp match {
case TempPolyType(tparams, restpe) => PolyType.fromSymbols(tparams, restpe)
@@ -356,7 +356,7 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleRoot: Clas
isUnpickleRoot(sym) ||
(sym is (ModuleClass | TypeParam | Scala2Existential)) ||
isRefinementClass(sym)))
- symScope(sym.owner) enter sym
+ symScope(sym.owner).openForMutations.enter(sym)
sym
}
@@ -519,7 +519,7 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleRoot: Clas
}
case CLASSINFOtpe =>
val clazz = readSymbolRef()
- TempClassInfoType(until(end, readTypeRef), symScope(clazz), clazz)
+ TempClassInfoType(until(end, readTypeRef), symScope(clazz).openForMutations, clazz)
case METHODtpe | IMPLICITMETHODtpe =>
val restpe = readTypeRef()
val params = until(end, readSymbolRef)