Skip to content
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

EXISTENTIAL flag is not pickled causing spurious declarations being created during unpickling #6692

Closed
scabug opened this issue Nov 20, 2012 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Nov 20, 2012

EXISTENTIAL flag is declared as following constant (in 2.9.x branch):

final val EXISTENTIAL   = 0x800000000L  // type is an existential parameter or skolem

The PickledFlags defined in the same file determines which flags get pickled:

final val PickledFlags: Long  = 0xFFFFFFFFL

Simple REPL experiment (instead of counting number of zeros...) shows that EXISTENTIAL flag does not get pickled:

scala> final val EXISTENTIAL   = 0x800000000L
EXISTENTIAL: Long(34359738368L) = 34359738368

scala> final val PickledFlags: Long  = 0xFFFFFFFFL
PickledFlags: Long = 4294967295

scala> EXISTENTIAL & PickledFlags
res0: Long = 0

This results in symbols for existential types being entered as decls when unpickling:

if (sym.owner.isClass && sym != classRoot && sym != moduleRoot &&
            !sym.isModuleClass && !sym.isRefinementClass && !sym.isTypeParameter && !sym.isExistentiallyBound)
          symScope(sym.owner) enter sym

due to !sym.isExistentiallyBound returning wrong result (true). This has severe consequences for sbt's incremental compilation because sbt thinks that API has changed. See https://groups.google.com/d/topic/simple-build-tool/Anumu_erCVY/discussion for example.

@scabug
Copy link
Author

scabug commented Nov 20, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6692?orig=1
Reporter: @gkossakowski
Affected Versions: 2.9.2
Other Milestones: 2.10.0

@scabug
Copy link
Author

scabug commented Nov 20, 2012

@paulp said:
See also this, which apparently missed the whole 2.9 series despite predating it:

commit 4df206e6402f2e56bc450818acc14a707101c390
Author: Paul Phillips <paulp@improving.org>
Date:   1 year, 5 months ago

    Existentially quantified symbols, when read by ...
    
    Existentially quantified symbols, when read by the unpickler, do not
    have the existential flag set. This leads to failure. This patch seeks
    improvement. Closes #4757, review by odersky.

and it came back out a year later (presumably after the set of pickled flags was expanded)

commit 3e2c31fbebfd723e8a9afd28cbd0a62659466069 (refs/pull/887/head)
Author: Paul Phillips <paulp@improving.org>
Date:   4 months ago

    Removed EXISTENTIAL special case in unpickler.

@scabug
Copy link
Author

scabug commented Nov 20, 2012

@paulp said:
Correction: it doesn't predate 2.9.0, only the later ones.

@scabug
Copy link
Author

scabug commented Nov 20, 2012

@gkossakowski said:
Yes, I should mention that in 2.10.x branch this is fixed.

@scabug
Copy link
Author

scabug commented Nov 21, 2012

@scabug
Copy link
Author

scabug commented Dec 12, 2012

@adriaanm said:
for 2.9.3: scala/scala#1761
test in sbt as soon as 2.9.3 is released: harrah/xsbt#623

@scabug scabug closed this as completed Dec 13, 2012
@scabug
Copy link
Author

scabug commented Dec 13, 2012

@adriaanm said:
fixed for 2.9.3 in scala/scala#1761

@scabug scabug added this to the 2.9.3-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants