Skip to content

Commit c17b9b4

Browse files
committed
SI-6692 pickle one more flag bit: EXISTENTIAL
before, PickledFlags & EXISTENTIAL == 0, so that an existential symbol would lose the EXISTENTIAL bit when pickled, causing spurious incremental recompiles, as pickled information and type-checking-from-source-based information differed pickling this additional bit should be a compatible change, as older versions (pre-2.9.3) will simply mask out the extra flag bits pickled as of now (2.9.3) so that their behavior is not affected -- newer versions will see more flags, which might cause regressions, but it's also the only way to fix SI-6692 this obviates the need to set the existential flag when unpickling an existential type's params this is the smallest backport of a9b85db and 3e2c31f that I could think of as 2.9 is in maintenance mode, I don't want to invest in testing infrastructure to test the pickler, however, the fix is tested by the incremental compiler test 'inc-pickled-existential' in sbt
1 parent 3d2bcf2 commit c17b9b4

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/library/scala/reflect/generic/Flags.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ object ModifierFlags extends ModifierFlags
100100

101101
private final val PKL_MASK = 0x00000FFF
102102

103-
final val PickledFlags: Long = 0xFFFFFFFFL
103+
// must pickle EXISTENTIAL for SI-6692
104+
final val PickledFlags: Long = 0x8FFFFFFFFL
104105

105106
private def rawPickledCorrespondence = Array(
106107
(IMPLICIT, IMPLICIT_PKL),

src/library/scala/reflect/generic/UnPickler.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,7 @@ abstract class UnPickler {
396396
NullaryMethodType(restpe)
397397
case EXISTENTIALtpe =>
398398
val restpe = readTypeRef()
399-
val tparams = until(end, readSymbolRef)
400-
// binary compatibility: in 2.9.x, Symbol doesn't have setFlag
401-
tparams foreach (x => x.asInstanceOf[{ def setFlag(mask: Long): this.type }] setFlag EXISTENTIAL)
402-
ExistentialType(tparams, restpe)
399+
ExistentialType(until(end, readSymbolRef), restpe)
403400
case ANNOTATEDtpe =>
404401
var typeRef = readNat()
405402
val selfsym = if (isSymbolRef(typeRef)) {

0 commit comments

Comments
 (0)