diff options
author | Martin Odersky <odersky@gmail.com> | 2014-02-19 11:50:13 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-02-21 18:42:50 +0100 |
commit | f699ba201bafccc66657a2765f280a226fcd9e55 (patch) | |
tree | f44f9f9295c781bf182e8eafd25dfda3f6e8c8f3 /src/dotty/tools/dotc/core/pickling/UnPickler.scala | |
parent | 77fc4d0831dc7a7ddaa74677e2659cdea4a2f52f (diff) | |
download | dotty-f699ba201bafccc66657a2765f280a226fcd9e55.tar.gz dotty-f699ba201bafccc66657a2765f280a226fcd9e55.tar.bz2 dotty-f699ba201bafccc66657a2765f280a226fcd9e55.zip |
Avoid using TypeBounds in alias refinements.
The idea is to use the alias itself. This cuts down on # of typebounds created and makes operations on refined infos and applied types more direct.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index 78a91b2ef..e5cbdf53b 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -560,15 +560,16 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: def elim(tp: Type): Type = tp match { case tp @ RefinedType(parent, name) => val parent1 = elim(tp.parent) - tp.refinedInfo match { - case TypeAlias(info: TypeRef) if boundSyms contains info.symbol => - RefinedType(parent1, name, info.symbol.info) + tp.compactInfo match { case info: TypeRef if boundSyms contains info.symbol => val info1 = info.symbol.info - assert(info1.derivesFrom(defn.SingletonClass)) - RefinedType(parent1, name, info1.mapReduceAnd(removeSingleton)(_ & _)) - case info => - tp.derivedRefinedType(parent1, name, info) + if (tp.isAliasRefinement) RefinedType(parent1, name, info1) + else { + assert(info1.derivesFrom(defn.SingletonClass)) + RefinedType(parent1, name, info1.mapReduceAnd(removeSingleton)(_ & _)) + } + case cinfo => + tp.derivedRefinedType(parent1, name, cinfo) } case _ => tp |