Skip to content

Commit 990469e

Browse files
authored
Merge pull request #4134 from dotty-staging/fix/tasty-erased
Pickle the Erased modifier
2 parents b750469 + 5a94015 commit 990469e

File tree

5 files changed

+8
-11
lines changed

5 files changed

+8
-11
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ object TastyFormat {
227227

228228
final val header = Array(0x5C, 0xA1, 0xAB, 0x1F)
229229
val MajorVersion = 5
230-
val MinorVersion = 0
230+
val MinorVersion = 1
231231

232232
/** Tags used to serialize names */
233233
class NameTags {
@@ -299,6 +299,7 @@ object TastyFormat {
299299
final val DEFAULTparameterized = 30
300300
final val STABLE = 31
301301
final val MACRO = 32
302+
final val ERASED = 33
302303

303304
// Cat. 2: tag Nat
304305

@@ -424,7 +425,7 @@ object TastyFormat {
424425

425426
/** Useful for debugging */
426427
def isLegalTag(tag: Int) =
427-
firstSimpleTreeTag <= tag && tag <= MACRO ||
428+
firstSimpleTreeTag <= tag && tag <= ERASED ||
428429
firstNatTreeTag <= tag && tag <= SYMBOLconst ||
429430
firstASTTreeTag <= tag && tag <= SINGLETONtpt ||
430431
firstNatASTTreeTag <= tag && tag <= NAMEDARG ||
@@ -442,6 +443,7 @@ object TastyFormat {
442443
| SEALED
443444
| CASE
444445
| IMPLICIT
446+
| ERASED
445447
| LAZY
446448
| OVERRIDE
447449
| INLINE
@@ -496,6 +498,7 @@ object TastyFormat {
496498
case SEALED => "SEALED"
497499
case CASE => "CASE"
498500
case IMPLICIT => "IMPLICIT"
501+
case ERASED => "ERASED"
499502
case LAZY => "LAZY"
500503
case OVERRIDE => "OVERRIDE"
501504
case INLINE => "INLINE"

compiler/src/dotty/tools/dotc/core/tasty/TastyPrinter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) {
6969
printName(); printTree(); printTrees()
7070
case RETURN | HOLE =>
7171
printNat(); printTrees()
72-
case METHODtype | POLYtype | TYPELAMBDAtype =>
72+
case METHODtype | IMPLICITMETHODtype | ERASEDMETHODtype | ERASEDIMPLICITMETHODtype | POLYtype | TYPELAMBDAtype =>
7373
printTree()
7474
until(end) { printName(); printTree() }
7575
case PARAMtype =>

compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ class TreePickler(pickler: TastyPickler) {
593593
if (flags is Scala2x) writeByte(SCALA2X)
594594
if (sym.isTerm) {
595595
if (flags is Implicit) writeByte(IMPLICIT)
596+
if (flags is Erased) writeByte(ERASED)
596597
if ((flags is Lazy) && !(sym is Module)) writeByte(LAZY)
597598
if (flags is AbsOverride) { writeByte(ABSTRACT); writeByte(OVERRIDE) }
598599
if (flags is Mutable) writeByte(MUTABLE)

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ class TreeUnpickler(reader: TastyReader,
565565
case SEALED => addFlag(Sealed)
566566
case CASE => addFlag(Case)
567567
case IMPLICIT => addFlag(Implicit)
568+
case ERASED => addFlag(Erased)
568569
case LAZY => addFlag(Lazy)
569570
case OVERRIDE => addFlag(Override)
570571
case INLINE => addFlag(Inline)

compiler/test/dotty/tools/dotc/FromTastyTests.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ class FromTastyTests extends ParallelTesting {
104104
"phantom-poly-2.scala",
105105
"phantom-poly-3.scala",
106106
"phantom-poly-4.scala",
107-
108-
// Issue with JFunction1$mcI$sp/T
109-
"erased-15.scala",
110-
"erased-17.scala",
111-
"erased-20.scala",
112-
"erased-21.scala",
113-
"erased-23.scala",
114-
"erased-value-class.scala",
115107
)
116108
)
117109
step1.checkCompile() // Compile all files to generate the class files with tasty

0 commit comments

Comments
 (0)