aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-10-31 15:09:34 +0100
committerMartin Odersky <odersky@gmail.com>2016-10-31 15:09:34 +0100
commit8b10844da492292d1fd70bf94f639fe70f88fcd2 (patch)
treec1880e7a90b0f8dd2827a0225ec8ad7476afc239 /src
parent0fd8804b3a2ce9a2099a3d7c1b756fec637f9d1c (diff)
downloaddotty-8b10844da492292d1fd70bf94f639fe70f88fcd2.tar.gz
dotty-8b10844da492292d1fd70bf94f639fe70f88fcd2.tar.bz2
dotty-8b10844da492292d1fd70bf94f639fe70f88fcd2.zip
Eliminate LAMBDAtype from TASTYformat
Merge with POLYtypem, as we do already for internal types.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/tasty/TastyFormat.scala12
-rw-r--r--src/dotty/tools/dotc/core/tasty/TreePickler.scala2
-rw-r--r--src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala9
3 files changed, 7 insertions, 16 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
index a8725136d..f9743d9d2 100644
--- a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
+++ b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
@@ -139,12 +139,11 @@ Standard-Section: "ASTs" TopLevelStat*
BIND Length boundName_NameRef bounds_Type
// for type-variables defined in a type pattern
BYNAMEtype underlying_Type
- LAMBDAtype Length result_Type NamesTypes // variance encoded in front of name: +/-/=
- POLYtype Length result_Type NamesTypes // needed for refinements
+ POLYtype Length result_Type NamesTypes // variance encoded in front of name: +/-/=
METHODtype Length result_Type NamesTypes // needed for refinements
PARAMtype Length binder_ASTref paramNum_Nat // needed for refinements
SHARED type_ASTRef
- NamesTypes = ParamType*
+ NamesTypes = NameType*
NameType = paramName_NameRef typeOrBounds_ASTRef
Modifier = PRIVATE
@@ -325,9 +324,8 @@ object TastyFormat {
final val ORtype = 172
final val METHODtype = 174
final val POLYtype = 175
- final val LAMBDAtype = 176
- final val PARAMtype = 177
- final val ANNOTATION = 178
+ final val PARAMtype = 176
+ final val ANNOTATION = 177
final val firstSimpleTreeTag = UNITconst
final val firstNatTreeTag = SHARED
@@ -489,7 +487,7 @@ object TastyFormat {
case PROTECTEDqualified => "PROTECTEDqualified"
}
- /** @return If non-negative, the number of leading references of a length/trees entry.
+ /** @return If non-negative, the number of leading references (represented as nats) of a length/trees entry.
* If negative, minus the number of leading non-reference trees.
*/
def numRefs(tag: Int) = tag match {
diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala
index f0d8da9df..9dfb78798 100644
--- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala
@@ -262,7 +262,7 @@ class TreePickler(pickler: TastyPickler) {
writeByte(BYNAMEtype)
pickleType(tpe.underlying)
case tpe: PolyType =>
- writeByte(LAMBDAtype)
+ writeByte(POLYtype)
val paramNames = tpe.typeParams.map(tparam =>
varianceToPrefix(tparam.paramVariance) +: tparam.paramName)
pickleMethodic(tpe.resultType, paramNames, tpe.paramBounds)
diff --git a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index c2779ba88..a0d788955 100644
--- a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -266,7 +266,7 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle
val sym = ctx.newSymbol(ctx.owner, readName().toTypeName, BindDefinedType, readType())
registerSym(start, sym)
TypeRef.withFixedSym(NoPrefix, sym.name, sym)
- case LAMBDAtype =>
+ case POLYtype =>
val (rawNames, paramReader) = readNamesSkipParams
val (variances, paramNames) = rawNames
.map(name => (prefixToVariance(name.head), name.tail.toTypeName)).unzip
@@ -275,13 +275,6 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle
pt => readType())
goto(end)
result
- case POLYtype =>
- val (names, paramReader) = readNamesSkipParams
- val result = PolyType(names.map(_.toTypeName))(
- pt => registeringType(pt, paramReader.readParamTypes[TypeBounds](end)),
- pt => readType())
- goto(end)
- result
case METHODtype =>
val (names, paramReader) = readNamesSkipParams
val result = MethodType(names.map(_.toTermName), paramReader.readParamTypes[Type](end))(