Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
som-snytt wants to merge1 commit intoscala:2.13.xfromsom-snytt:issue/5159

Conversation

som-snytt
Copy link
Contributor

-Yuntil:refchecks to limp onward and witness
helpful errors in refchecks.

Fixesscala/bug#5159

`-Yuntil:refchecks` to limp onward and witnesshelpful errors in refchecks.
@scala-jenkinsscala-jenkins added this to the2.13.4 milestoneJul 31, 2020
Copy link
Member

@dwijnanddwijnand left a 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)

@sjrd
Copy link
Member

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.

dwijnand, SethTisue, and lrytz reacted with thumbs up emoji

@dwijnand
Copy link
Member

Are you against it or are you saying this needs some amends to set expectations appropriately?

@sjrd
Copy link
Member

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
Copy link
Member

dwijnand commentedAug 12, 2020
edited
Loading

I'm sure you'll notice how bad this is.

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.

@som-snytt
Copy link
ContributorAuthor

I considered restricting to-Yrun-to-refchecks, which may be the only use case.

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-Y has a low bar. There have always been-Y options that are crashy or unstable.

The counter-argument is that-Wconf is supposed to let you ignore an error. Is it convenient enough for the use case, "What would refchecks say?"-Wwrs.

@som-snyttsom-snytt marked this pull request as draftAugust 25, 2020 16:41
@som-snytt
Copy link
ContributorAuthor

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.

@lrytz
Copy link
Member

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?

@som-snytt
Copy link
ContributorAuthor

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.

@sjrd
Copy link
Member

@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?

  • Only refchecks could report spurious errors for codebases with (arguably bad?) compiler plugins inserting a phase between typer and refchecks that "fixes" things that would otherwise be reported by refchecks. It's not entirely unheard of: I think that Mill has such a phase to slapoverride automatically for you.
  • Everything until refchecks could have other consequences, this time with a larger set of compiler plugins: every phase added by a compiler plugin between typer and refchecks might crash on unexpected inputs.

Now, if we auditrefchecks well enough, and test it well enough on inputs that don't pass typer, then at least we could limit the new-kinds-of-crashes area to such compiler plugins.

Testing it well enough, IMO, is at the very least testing thatrefchecks does not crash on any of the existing neg tests.

@lrytz
Copy link
Member

Did you mean to runonly refchecks

Yes - but i see your point about plugins.

@dwijnanddwijnand removed this from the2.13.4 milestoneOct 16, 2020
@som-snyttsom-snytt deleted the issue/5159 branchDecember 19, 2020 01:15
@som-snytt
Copy link
ContributorAuthor

Summary, a tool that runs only "checks" after failing typer and probably only to refchecks checks.

@som-snyttsom-snytt changed the titleAllow progress after erroring[REJECTED/REVISIT] Allow progress after erroringJan 27, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dwijnanddwijnanddwijnand approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Wrong (misleading) error in code that is (non-obviously) incorrect
5 participants
@som-snytt@sjrd@dwijnand@lrytz@scala-jenkins

[8]ページ先頭

©2009-2025 Movatter.jp