- Notifications
You must be signed in to change notification settings - Fork3.1k
[REJECTED/REVISIT] Allow progress after erroring#9145
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
`-Yuntil:refchecks` to limp onward and witnesshelpful errors in refchecks.
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.
I like it. I'm not sure I'll always remember to use it, but it's 5 extra lines around it (at least right now... famous last words!) to add a possibly very useful tool to the tool bag.
Particularly if this were accepted I may now start to collapse my partests without being paranoid that warnings (made fatal) in earlier phases are hiding away warnings emitted in later phases from being present in the checkfiles... (e.g. the nullary method/Xsource:3 warnings)
This opens many new ways that the compiler could crash. Until now, all phases could assume that the previous phases ran without error, and that, therefore, the program respected all invariants checked by previous phases. For example, all phases after typer assume that there is no erroneous type in trees. If you allow phases to run after another one had errors, you break this. This could lead to many new compiler crashes. |
Are you against it or are you saying this needs some amends to set expectations appropriately? |
I'm against it. This breaks invariants that the compiler relies on not to crash. Unless there is an audit of all phases to identify and fix all places where they rely on those invariants, this change basically creates new crashes by design. And that's even without counting compiler plugins. Try and enable this flag with "until cleanup" on all neg tests: I'm sure you'll notice how bad this is. |
dwijnand commentedAug 12, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
How bad is it? A -Y flag that may cause new compiler crashes doesn't concern me, provided it doesn't do something destructive like delete the source files. |
I considered restricting to Conceivably, someone may like to ignore some unrelated error to exercise a plugin which runs later. I don't have a strong argument for that use case; a plugin author might chime in to say they needed that once. The argument in favor is that The counter-argument is that |
Drafting for improved ergonomics and sjrd-friendliness. For a single run, enabling refchecks is viable even with potential for crash, but not in resident or incremental case. As noted above, when would you even think to enable a flag? If compiler doesn't do refchecks safely always to add more info to error case, then there isn't much point. |
I'm also against this feature in its generality. What I could imagine is a way to run only refchecks (possibly with some of its checks / transformations disabled) after an erroneous typer phase. Running other phases doesn't make sense, they don't report any errors (except maybe some of the form "this is OK Scala code but sadly can't be represented in classfiles, sorry"). @sjrd what do you think about that? |
I just noticed a semantically relevant dotty error obscured by a subsequent error. (As happens.) I want to see the "previous" error. Here, I want to run short-circuited checks and see those "subsequent" errors. It's like a Stephen Hawking thing where peering into the past is symmetrical to peering into the future. |
@lrytz That is clearly less bad than the general feature. Did you mean to runonly refchecks (and not other phases between typer and refchecks) or everything until refchecks?
Now, if we audit Testing it well enough, IMO, is at the very least testing that |
Yes - but i see your point about plugins. |
Summary, a tool that runs only "checks" after failing typer and probably only to refchecks checks. |
-Yuntil:refchecks
to limp onward and witnesshelpful errors in refchecks.
Fixesscala/bug#5159