aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-04-07 21:44:06 +0200
committerMartin Odersky <odersky@gmail.com>2015-04-07 23:53:59 +0200
commit73e7181becbb2c7393d402c6234c4321d7f2704b (patch)
tree2768db6263acfc909d00e144ffc13d6a20e927a9 /src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
parent2d45d5b23983fa20b353fc83ba4e9b8585e5f662 (diff)
downloaddotty-73e7181becbb2c7393d402c6234c4321d7f2704b.tar.gz
dotty-73e7181becbb2c7393d402c6234c4321d7f2704b.tar.bz2
dotty-73e7181becbb2c7393d402c6234c4321d7f2704b.zip
Simplified unpickling of refined types via nextUnsharedTag
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala b/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
index a1a630d92..c46ff8d6f 100644
--- a/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/TreeUnpickler.scala
@@ -183,17 +183,11 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
case REFINEDtype =>
val parent = readType()
var name: Name = readName()
- if (nextByte == SHARED) {
- val refinedInfo = readType()
- if (refinedInfo.isInstanceOf[TypeBounds]) name = name.toTypeName
- RefinedType(parent, name, refinedInfo)
- }
- else {
- if (nextByte == TYPEBOUNDS || nextByte == TYPEALIAS) name = name.toTypeName
- RefinedType(parent, name, rt => registeringType(rt, readType()))
- // Note that the lambda is not equivalent to a wildcard closure!
- // Eta expansion of the latter puts readType() out of the expression.
- }
+ val ttag = nextUnsharedTag
+ if (ttag == TYPEBOUNDS || ttag == TYPEALIAS) name = name.toTypeName
+ RefinedType(parent, name, rt => registeringType(rt, readType()))
+ // Note that the lambda "rt => ..." is not equivalent to a wildcard closure!
+ // Eta expansion of the latter puts readType() out of the expression.
case APPLIEDtype =>
readType().appliedTo(until(end)(readType()))
case TYPEBOUNDS =>