Skip to content

Add pickling/unpickling of stable modifier #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/dotty/tools/dotc/core/tasty/TastyFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Standard-Section: "ASTs" TopLevelStat*
SCALA2X // Imported from Scala2.x
DEFAULTparameterized // Method with default params
INSUPERCALL // defined in the argument of a constructor supercall
STABLE // Method that is assumed to be stable
Annotation
Annotation = ANNOTATION Length tycon_Type fullAnnotation_Term

Expand Down Expand Up @@ -220,7 +221,7 @@ object TastyFormat {
final val DEFAULTGETTER = 7
final val SHADOWED = 8

// AST tags
// AST tags

final val UNITconst = 2
final val FALSEconst = 3
Expand Down Expand Up @@ -252,6 +253,7 @@ object TastyFormat {
final val SCALA2X = 29
final val DEFAULTparameterized = 30
final val INSUPERCALL = 31
final val STABLE = 32

final val SHARED = 64
final val TERMREFdirect = 65
Expand Down Expand Up @@ -362,6 +364,7 @@ object TastyFormat {
| SCALA2X
| DEFAULTparameterized
| INSUPERCALL
| STABLE
| ANNOTATION
| PRIVATEqualified
| PROTECTEDqualified => true
Expand Down Expand Up @@ -409,6 +412,7 @@ object TastyFormat {
case SCALA2X => "SCALA2X"
case DEFAULTparameterized => "DEFAULTparameterized"
case INSUPERCALL => "INSUPERCALL"
case STABLE => "STABLE"

case SHARED => "SHARED"
case TERMREFdirect => "TERMREFdirect"
Expand Down
1 change: 1 addition & 0 deletions src/dotty/tools/dotc/core/tasty/TreePickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ class TreePickler(pickler: TastyPickler) {
if (flags is Accessor) writeByte(FIELDaccessor)
if (flags is CaseAccessor) writeByte(CASEaccessor)
if (flags is DefaultParameterized) writeByte(DEFAULTparameterized)
if (flags is Stable) writeByte(STABLE)
} else {
if (flags is Sealed) writeByte(SEALED)
if (flags is Abstract) writeByte(ABSTRACT)
Expand Down
1 change: 1 addition & 0 deletions src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
case SCALA2X => addFlag(Scala2x)
case DEFAULTparameterized => addFlag(DefaultParameterized)
case INSUPERCALL => addFlag(InSuperCall)
case STABLE => addFlag(Stable)
case PRIVATEqualified =>
readByte()
privateWithin = readType().typeSymbol
Expand Down
1 change: 1 addition & 0 deletions test/dotc/tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,5 @@ class tests extends CompilerTest {
@Test def tasty_dotc_reporting = compileDir(dotcDir, "reporting", testPickling)
@Test def tasty_dotc_util = compileDir(dotcDir, "util", testPickling)
@Test def tasty_tools_io = compileDir(toolsDir, "io", testPickling)
@Test def tasty_tests = compileDir(testsDir, "tasty", testPickling)
}
8 changes: 8 additions & 0 deletions tests/tasty/i982.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
trait Z {
type Q
def test: Q
}
class X(val x: Z)
class Y(x: Z) extends X(x) {
x.test
}