diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala index 6144f015ebd7..44305412e09c 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala @@ -227,7 +227,7 @@ object TastyFormat { final val header = Array(0x5C, 0xA1, 0xAB, 0x1F) val MajorVersion = 5 - val MinorVersion = 0 + val MinorVersion = 1 /** Tags used to serialize names */ class NameTags { @@ -299,6 +299,7 @@ object TastyFormat { final val DEFAULTparameterized = 30 final val STABLE = 31 final val MACRO = 32 + final val ERASED = 33 // Cat. 2: tag Nat @@ -424,7 +425,7 @@ object TastyFormat { /** Useful for debugging */ def isLegalTag(tag: Int) = - firstSimpleTreeTag <= tag && tag <= MACRO || + firstSimpleTreeTag <= tag && tag <= ERASED || firstNatTreeTag <= tag && tag <= SYMBOLconst || firstASTTreeTag <= tag && tag <= SINGLETONtpt || firstNatASTTreeTag <= tag && tag <= NAMEDARG || @@ -442,6 +443,7 @@ object TastyFormat { | SEALED | CASE | IMPLICIT + | ERASED | LAZY | OVERRIDE | INLINE @@ -496,6 +498,7 @@ object TastyFormat { case SEALED => "SEALED" case CASE => "CASE" case IMPLICIT => "IMPLICIT" + case ERASED => "ERASED" case LAZY => "LAZY" case OVERRIDE => "OVERRIDE" case INLINE => "INLINE" diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala index dbf563e7b2ac..fd94296fd93d 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala @@ -69,7 +69,7 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) { printName(); printTree(); printTrees() case RETURN | HOLE => printNat(); printTrees() - case METHODtype | POLYtype | TYPELAMBDAtype => + case METHODtype | IMPLICITMETHODtype | ERASEDMETHODtype | ERASEDIMPLICITMETHODtype | POLYtype | TYPELAMBDAtype => printTree() until(end) { printName(); printTree() } case PARAMtype => diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 618130db3017..7fd249d9f260 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -593,6 +593,7 @@ class TreePickler(pickler: TastyPickler) { if (flags is Scala2x) writeByte(SCALA2X) if (sym.isTerm) { if (flags is Implicit) writeByte(IMPLICIT) + if (flags is Erased) writeByte(ERASED) if ((flags is Lazy) && !(sym is Module)) writeByte(LAZY) if (flags is AbsOverride) { writeByte(ABSTRACT); writeByte(OVERRIDE) } if (flags is Mutable) writeByte(MUTABLE) diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 981c53f667aa..7945e4710677 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -565,6 +565,7 @@ class TreeUnpickler(reader: TastyReader, case SEALED => addFlag(Sealed) case CASE => addFlag(Case) case IMPLICIT => addFlag(Implicit) + case ERASED => addFlag(Erased) case LAZY => addFlag(Lazy) case OVERRIDE => addFlag(Override) case INLINE => addFlag(Inline) diff --git a/compiler/test/dotty/tools/dotc/FromTastyTests.scala b/compiler/test/dotty/tools/dotc/FromTastyTests.scala index 1e4a1c2e25bb..2dee6f9e7040 100644 --- a/compiler/test/dotty/tools/dotc/FromTastyTests.scala +++ b/compiler/test/dotty/tools/dotc/FromTastyTests.scala @@ -104,14 +104,6 @@ class FromTastyTests extends ParallelTesting { "phantom-poly-2.scala", "phantom-poly-3.scala", "phantom-poly-4.scala", - - // Issue with JFunction1$mcI$sp/T - "erased-15.scala", - "erased-17.scala", - "erased-20.scala", - "erased-21.scala", - "erased-23.scala", - "erased-value-class.scala", ) ) step1.checkCompile() // Compile all files to generate the class files with tasty