Skip to content

Not give up on compilation instantly when -Werror is on and warning appears #18634

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

Closed
szymon-rd opened this issue Oct 2, 2023 · 2 comments · Fixed by #19245
Closed

Not give up on compilation instantly when -Werror is on and warning appears #18634

szymon-rd opened this issue Oct 2, 2023 · 2 comments · Fixed by #19245
Assignees
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug
Milestone

Comments

@szymon-rd
Copy link
Contributor

Compiler version

3.3.1

The problem

When warnings are reported in a phase and -Werror (XfatalWarnings) is on, they will be reported as errors and compilation will crash. Because of that, instead of reporting all warnings from linting in a unit, the compilation will exit with an error after just one phase - therefore it does not report warnings from future phases. it would make more sense to aggregate these warnings and report them as errors after the linting phases.

@szymon-rd szymon-rd added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:linting Linting warnings enabled with -W or -Xlint and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 2, 2023
@szymon-rd szymon-rd self-assigned this Oct 2, 2023
@szymon-rd
Copy link
Contributor Author

szymon-rd commented Oct 31, 2023

It seems that the decision to report warnings differently than in Scala 2 was made here: https://github.com/lampepfl/dotty/pull/2341/files
It was a good decision at the time, but I don't see any strong argument made to do it that way instead of the previous approach. I think we can just go back and change it if users don't have anything against it.

@som-snytt
Copy link
Contributor

Conceptually, warnings filtering happens at the end of the run, as an operation on cached warnings.

Off the top of my head, I'm not sure what -Werror means if all warnings have been silenced, but I would guess compilation does not fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug
Projects
None yet
3 participants