Skip to content

Fix #643 - Scala2 unpickling now sets NoInits flag for interfaces. #663

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 5 commits into from
Jun 19, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 15, 2015

ClassfileParser did it already correctly, but Scala2 unpickler did not. Review by @DarkDimius

Note: Course-2002-07 now crashes with a different error.

@DarkDimius
Copy link
Contributor

16 tests failed with StaleSymbolError

@odersky
Copy link
Contributor Author

odersky commented Jun 16, 2015

I am on it. UNravelling a rather interesting thread.

odersky added 5 commits June 16, 2015 16:42
Refinement classes and their members could give spurious stale symbol errors if the
symbol is loaded in a different run than the classfile containing it. The problem
is that refinement classes do not form part of the scope of their owners. The fix
assumes that refinement classes are always "stillValid".
Found while trying to chase down the problem with stale symbols in last commit. Double negation
is confusing. The new formulation avoids it.
The previous stale symbol was discovered because NormalizeFlags looks
at all declarations of a MoInits trait in the SymTransformer. I.e it does
this for all no-init traits, whether loaded from a classfile or currently
compiled. This is wasteful because it forces too many definitions.

The new scheme drops the scan in favor of producing PureInterface
together with NoInits. PureInterface is already read as a flag from
Java snd Scala2 classfiles. For source and Tasty it is now generated
as members are indexed.
Instead of classifying class members with a TreeInfo.DefKind, we
use directly the flags into which kinds were previously translated.
NoInits is implied for pure interfaces, so has to be set. The Java classfile parser
already does the right thing here.
@odersky odersky force-pushed the fix/#643-scala2-noinits branch from 97f6348 to 0e6b857 Compare June 16, 2015 14:43
@DarkDimius
Copy link
Contributor

LGTM

DarkDimius added a commit that referenced this pull request Jun 19, 2015
Fix #643 - Scala2 unpickling now sets NoInits flag for interfaces.
@DarkDimius DarkDimius merged commit 05e81c1 into scala:master Jun 19, 2015
@allanrenucci allanrenucci deleted the fix/#643-scala2-noinits branch December 14, 2017 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants