diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-09 14:06:27 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-19 10:36:32 +0200 |
commit | b34d57ce447f819f258aad02030accca3906e845 (patch) | |
tree | 9f5b6ecebf32d5a1fe622922822f0db2c3af43e8 /src | |
parent | d982038e00ceb02673e8a6c0f6b995f772456417 (diff) | |
download | dotty-b34d57ce447f819f258aad02030accca3906e845.tar.gz dotty-b34d57ce447f819f258aad02030accca3906e845.tar.bz2 dotty-b34d57ce447f819f258aad02030accca3906e845.zip |
Don't keep SkolemTypes in TASTY
SkolemTypes are no longer needed when Pickling because they exist only
for checking type-safety. After the typer, we can safely eliminate them.
Not having skolem types in TASTY simplifies the format and avoids having
to explain a difficult concept.
Diffstat (limited to 'src')
5 files changed, 14 insertions, 18 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala index 1022fc4da..630e25a32 100644 --- a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala +++ b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala @@ -104,7 +104,6 @@ Standard-Section: "ASTs" TopLevelStat* TERMREF possiblySigned_NameRef qual_Type THIS clsRef_Type REFINEDthis refinedType_ASTRef - SKOLEMtype Type_ASTRef SHARED path_ASTRef Constant = UNITconst @@ -261,17 +260,16 @@ object TastyFormat { final val TYPEREFdirect = 66 final val TERMREFpkg = 67 final val TYPEREFpkg = 68 - final val SKOLEMtype = 69 - final val REFINEDthis = 70 - final val BYTEconst = 71 - final val SHORTconst = 72 - final val CHARconst = 73 - final val INTconst = 74 - final val LONGconst = 75 - final val FLOATconst = 76 - final val DOUBLEconst = 77 - final val STRINGconst = 78 - final val IMPORTED = 79 + final val REFINEDthis = 69 + final val BYTEconst = 70 + final val SHORTconst = 71 + final val CHARconst = 72 + final val INTconst = 73 + final val LONGconst = 74 + final val FLOATconst = 75 + final val DOUBLEconst = 76 + final val STRINGconst = 77 + final val IMPORTED = 78 final val THIS = 96 final val CLASSconst = 97 @@ -421,7 +419,7 @@ object TastyFormat { case TYPEREFdirect => "TYPEREFdirect" case TERMREFpkg => "TERMREFpkg" case TYPEREFpkg => "TYPEREFpkg" - case SKOLEMtype => "SKOLEMtype" + case REFINEDthis => "REFINEDthis" case BYTEconst => "BYTEconst" case SHORTconst => "SHORTconst" case CHARconst => "CHARconst" diff --git a/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/src/dotty/tools/dotc/core/tasty/TreePickler.scala index cd49f7c5a..99a5a587f 100644 --- a/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -202,7 +202,6 @@ class TreePickler(pickler: TastyPickler) { writeByte(REFINEDthis) writeRef(pickledTypes.get(tpe.binder).asInstanceOf[Addr]) case tpe: SkolemType => - writeByte(SKOLEMtype) pickleType(tpe.info) case tpe: RefinedType => val args = tpe.argInfos(interpolate = false) diff --git a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index d4260e679..5e77dd647 100644 --- a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -256,8 +256,6 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) { ThisType.raw(readType().asInstanceOf[TypeRef]) case REFINEDthis => RefinedThis(readTypeRef().asInstanceOf[RefinedType]) - case SKOLEMtype => - SkolemType(readTypeRef()) case SHARED => val ref = readAddr() typeAtAddr.getOrElseUpdate(ref, forkAt(ref).readType()) diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala index a7b338be8..86dd3878c 100644 --- a/src/dotty/tools/dotc/printing/PlainPrinter.scala +++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala @@ -231,7 +231,8 @@ class PlainPrinter(_ctx: Context) extends Printer { case tp: RefinedThis => s"${nameString(tp.binder.typeSymbol)}{...}.this" case tp: SkolemType => - "<unknown instance of type " ~ toTextGlobal(tp.info) ~ ">" + if (homogenizedView) toText(tp.info) + else "<unknown instance of type " ~ toTextGlobal(tp.info) ~ ">" } } diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala index cf80969bf..2288fe9c0 100644 --- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -179,7 +179,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { * * The body is simplified as follows * - if it is a TypeAlias, follow it - * - replace all references to of the form <skolem>.HK$i by references + * - replace all references to of the form <refined-this>.HK$i by references * without a prefix, because the latter print nicer. * */ |