-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bringing a symbol to a new run is broken #1895
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
Labels
Comments
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 11, 2017
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 11, 2017
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 11, 2017
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 11, 2017
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 27, 2017
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 27, 2017
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Jan 28, 2017
The test case works now. |
The test case only works because of the workaround in dotty-staging@51a458e, I believe the underlying problem is still here and could manifest itself in other ways. |
Reopening because I think this is important, but feel free to close with stat:revisit |
smarter
added a commit
that referenced
this issue
Jun 4, 2018
Fix #1895: Use proper validity period for extension methods
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summarizing what we discussed last month:
A common pattern in
InfoTransformer
likeExtensionMethods
is to create new symbols likefoo$extension
in the current phase and to add them to the declarations of a class in the next phase. This causes problem when we try to bring forward the denotation corresponding to such a symbol to a subsequent run, becausestillValid
considers a denotation to be valid if it's valid in its owner at the first phase it's defined, but at its first phase the symbol has no owner yet!Here is a testcase:
We can extend
stillValid
to also check the phase right after the first phase but that's still not enough because InfoTransformers are lazy and the InfoTransformer for the next phase might never have run in the initial run where the symbol was created! I've only been able to reproduce this using the sbt-based bootstrap of dotty by runningdotty-compiler-bootstrapped/test-only -- --tests=repl_all
. I currently work around this by explicitly forcing the denotation of extension methods at the phase where they're entered in their owner, but this is just a hack.@DarkDimius suggested that we always recompute denotations from pickling, doing this may require a lot of work.
The text was updated successfully, but these errors were encountered: