From a1049e6227d412ce6bdd9065a350cb20921987e2 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 3 Mar 2013 16:10:21 +0100 Subject: 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. --- src/dotty/tools/dotc/core/pickling/UnPickler.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala') 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) -- cgit v1.2.3