aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/UnPickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-27 10:48:16 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-27 10:55:47 +0200
commitbfb328ff64dcfa103c91dd0cd55a617e370d6ef3 (patch)
treeb7003776657a486c8fbfac43a7812b10555b0d5a /src/dotty/tools/dotc/core/pickling/UnPickler.scala
parent292ce6844a212b47defc671c91396d7cec86833b (diff)
downloaddotty-bfb328ff64dcfa103c91dd0cd55a617e370d6ef3.tar.gz
dotty-bfb328ff64dcfa103c91dd0cd55a617e370d6ef3.tar.bz2
dotty-bfb328ff64dcfa103c91dd0cd55a617e370d6ef3.zip
Make ThisTypes take TypeRefs instead of ClassSymbols
This avoids stale symbol errors and does not need the somewhat unsystematic symbol rebinding of the last commit.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index e82002c9f..b80e2322a 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -629,18 +629,18 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot:
var pre = readTypeRef()
val sym = readSymbolRef()
pre match {
- case ThisType(cls) =>
+ case thispre: ThisType =>
// The problem is that class references super.C get pickled as
// this.C. Dereferencing the member might then get an overriding class
// instance. The problem arises for instance for LinkedHashMap#MapValues
// and also for the inner Transform class in all views. We fix it by
// replacing the this with the appropriate super.
- if (sym.owner != cls) {
- val overriding = cls.decls.lookup(sym.name)
+ if (sym.owner != thispre.cls) {
+ val overriding = thispre.cls.decls.lookup(sym.name)
if (overriding.exists && overriding != sym) {
val base = pre.baseTypeWithArgs(sym.owner)
assert(base.exists)
- pre = SuperType(pre, base)
+ pre = SuperType(thispre, base)
}
}
case _ =>