diff options
author | Martin Odersky <odersky@gmail.com> | 2015-01-10 17:47:55 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-01-10 17:47:55 +0100 |
commit | 97aced07f273a31be69fd771a4e900a8e0cfa43a (patch) | |
tree | 5d97ce7b5da0dd2dcfec601d616e530129958faa /src/dotty/tools/dotc/core/pickling/UnPickler.scala | |
parent | 5f35b11ceb228e7a803263490f2d8e8a22ee2fe6 (diff) | |
download | dotty-97aced07f273a31be69fd771a4e900a8e0cfa43a.tar.gz dotty-97aced07f273a31be69fd771a4e900a8e0cfa43a.tar.bz2 dotty-97aced07f273a31be69fd771a4e900a8e0cfa43a.zip |
Reverting the idea that RefinedThis types take levels.
In the end, this did not buy us anything. What matters is that
- we can reliably identify RefinedThis types pointing to a given
refinement type. Making sure that the `binder` field of q RefinedThis
type in a refinedInfo is always the containing refined type is good
enough for that.
- we take care to rebind RefinedThis types in isSubType. This was leaky before,
is handled now better in the new isSubType.
So, in the end, adding a level was a needless complication. Also, as a next step
we should be able to identify skolem types and RefinedThis types.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index 2bea977f7..62ad39c07 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -660,8 +660,12 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: val parent = parents.reduceLeft(AndType(_, _)) if (decls.isEmpty) parent else { - def addRefinement(tp: Type, sym: Symbol) = - RefinedType(tp, sym.name, ctx.thisToRefinedThis(_, clazz, 0)(sym.info)) + def addRefinement(tp: Type, sym: Symbol) = { + def subst(info: Type, rt: RefinedType) = + if (clazz.isClass) info.substThis(clazz.asClass, RefinedThis(rt)) + else info // turns out some symbols read into `clazz` are not classes, not sure why this is the case. + RefinedType(tp, sym.name, subst(sym.info, _)) + } (parent /: decls.toList)(addRefinement).asInstanceOf[RefinedType] } case CLASSINFOtpe => |