diff options
author | odersky <odersky@gmail.com> | 2015-06-19 12:54:10 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-06-19 12:54:10 +0200 |
commit | 9ee21cfb57164b41c27e9afa83871fa5ab3cccbf (patch) | |
tree | 39b615ad96163c6a83e6bde0013b58c253695592 /src | |
parent | 0a504655329dc01a0dc91b847de7ac2b1a688692 (diff) | |
parent | 815209e12e76c61fcf992a4966c976f4c2ec5597 (diff) | |
download | dotty-9ee21cfb57164b41c27e9afa83871fa5ab3cccbf.tar.gz dotty-9ee21cfb57164b41c27e9afa83871fa5ab3cccbf.tar.bz2 dotty-9ee21cfb57164b41c27e9afa83871fa5ab3cccbf.zip |
Merge pull request #638 from dotty-staging/change/simplify-tasty
Change/simplify tasty
Diffstat (limited to 'src')
5 files changed, 36 insertions, 40 deletions
diff --git a/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/src/dotty/tools/dotc/core/tasty/TastyFormat.scala index 1022fc4da..94ed94052 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 @@ -158,7 +157,6 @@ Standard-Section: "ASTs" TopLevelStat* LAZY OVERRIDE INLINE // macro - ABSOVERRIDE // abstract override STATIC // mapped to static Java member OBJECT // an object or its class TRAIT // a trait @@ -239,39 +237,37 @@ object TastyFormat { final val LAZY = 14 final val OVERRIDE = 15 final val INLINE = 16 - final val ABSOVERRIDE = 17 - final val STATIC = 18 - final val OBJECT = 19 - final val TRAIT = 20 - final val LOCAL = 21 - final val SYNTHETIC = 22 - final val ARTIFACT = 23 - final val MUTABLE = 24 - final val LABEL = 25 - final val FIELDaccessor = 26 - final val CASEaccessor = 27 - final val COVARIANT = 28 - final val CONTRAVARIANT = 29 - final val SCALA2X = 30 - final val DEFAULTparameterized = 31 - final val INSUPERCALL = 32 + final val STATIC = 17 + final val OBJECT = 18 + final val TRAIT = 19 + final val LOCAL = 20 + final val SYNTHETIC = 21 + final val ARTIFACT = 22 + final val MUTABLE = 23 + final val LABEL = 24 + final val FIELDaccessor = 25 + final val CASEaccessor = 26 + final val COVARIANT = 27 + final val CONTRAVARIANT = 28 + final val SCALA2X = 29 + final val DEFAULTparameterized = 30 + final val INSUPERCALL = 31 final val SHARED = 64 final val TERMREFdirect = 65 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 @@ -351,7 +347,6 @@ object TastyFormat { | LAZY | OVERRIDE | INLINE - | ABSOVERRIDE | STATIC | OBJECT | TRAIT @@ -399,7 +394,6 @@ object TastyFormat { case LAZY => "LAZY" case OVERRIDE => "OVERRIDE" case INLINE => "INLINE" - case ABSOVERRIDE => "ABSOVERRIDE" case STATIC => "STATIC" case OBJECT => "OBJECT" case TRAIT => "TRAIT" @@ -421,7 +415,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..8847d2de3 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) @@ -523,7 +522,7 @@ class TreePickler(pickler: TastyPickler) { if (sym.isTerm) { if (flags is Implicit) writeByte(IMPLICIT) if ((flags is Lazy) && !(sym is Module)) writeByte(LAZY) - if (flags is AbsOverride) writeByte(ABSOVERRIDE) + if (flags is AbsOverride) { writeByte(ABSTRACT); writeByte(OVERRIDE) } if (flags is Mutable) writeByte(MUTABLE) if (flags is Accessor) writeByte(FIELDaccessor) if (flags is CaseAccessor) writeByte(CASEaccessor) diff --git a/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 683b3be22..e76b2e764 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()) @@ -433,7 +431,12 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) { case PRIVATE => addFlag(Private) case INTERNAL => ??? // addFlag(Internal) case PROTECTED => addFlag(Protected) - case ABSTRACT => addFlag(Abstract) + case ABSTRACT => + readByte() + nextByte match { + case OVERRIDE => addFlag(AbsOverride) + case _ => flags |= Abstract + } case FINAL => addFlag(Final) case SEALED => addFlag(Sealed) case CASE => addFlag(Case) @@ -441,7 +444,6 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) { case LAZY => addFlag(Lazy) case OVERRIDE => addFlag(Override) case INLINE => addFlag(Inline) - case ABSOVERRIDE => addFlag(AbsOverride) case STATIC => addFlag(JavaStatic) case OBJECT => addFlag(Module) case TRAIT => addFlag(Trait) 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. * */ |