-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Crash when calling Compiler.newRun() without a docCtx #13013
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
Conversation
You'll want to squash and force push one clean commit. But the change looks idiomatic. It would be nice if the |
It looks like you haven't signed the CLA yet, would you mind doing so at https://www.lightbend.com/contribute/cla/scala ? |
Apologies for the delay, have signed the CLA. Somewhat embarrassingly, though I use git every day for years, I'm not well-versed beyond basic checkout/commit/pull/branch/push. To squash and force-push as a single commit, would be something like this? $ git rebase -i HEAD~2 # Interactive rebase last 2 commits on local
# Select "Squash" from prompt
$ git commit
$ git push -f Or $ git reset --soft HEAD~2 && git commit
$ git push -f |
There's multiple ways to do it, if you squash using |
Okay I think I managed to get it sorted out. Let me know if it's still not right and we can give this a go again 😅 |
It looks good but to have the issue be automatically closed when this PR is merged, you need to include "Fixes #12988" somewhere in the body of the commit message (also this is nitpicking but ideally the first line of the commit message would be a bit more descriptive of what is being fixed e.g., "Fix crash when calling Compiler.newRun() without a docCtx") |
By the way, you can edit just the commit message by doing |
Thank you for this, I didn't know this and this definitely helps a lot. |
…`docCtx` Changes based on suggestion in the issue and the implementation currently seen here: https://github.com/lampepfl/dotty/blob/79fae194b80e136a243e7c7f949268166d169e1e/compiler/src/dotty/tools/dotc/typer/Namer.scala#L449
ctx.docCtx.get
-> ctx.docCtx.foreach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Changes based on suggestion in the issue:
java.util.NoSuchElementException: None.get
when usingCompiler.newRun()
duringContextBase.initialize()
#12998 (comment)And the implementation currently seen here:
https://github.com/lampepfl/dotty/blob/79fae194b80e136a243e7c7f949268166d169e1e/compiler/src/dotty/tools/dotc/typer/Namer.scala#L449