-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make fatal warnings not fail compilation early & aggregate warns #19245
Conversation
7b3b400
to
69927a4
Compare
cbe9041
to
ee10082
Compare
69927a4
to
6d759fb
Compare
ee10082
to
06d518d
Compare
6d759fb
to
78adb39
Compare
06d518d
to
daf1718
Compare
78adb39
to
2994d53
Compare
f8bbc39
to
2c46f0a
Compare
fb8e104
to
f21b0f3
Compare
2c46f0a
to
9ad6c72
Compare
039744e
to
bfe0c70
Compare
9ad6c72
to
68f4dbc
Compare
There was some problem with moving these tests to warn when I tried it before, but I will look a bit into that now to make sure. |
0f48680
to
f0b2216
Compare
I moved most of them to warn |
@@ -214,6 +209,10 @@ abstract class Reporter extends interfaces.ReporterResult { | |||
def incomplete(dia: Diagnostic)(using Context): Unit = | |||
incompleteHandler(dia, ctx) | |||
|
|||
def finalizeReporting()(using Context) = | |||
if (hasWarnings && ctx.settings.XfatalWarnings.value) | |||
report(new Error("No warnings can be incurred under -Werror.", NoSourcePosition)) |
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.
report(new Error("No warnings can be incurred under -Werror.", NoSourcePosition)) | |
report(new Error("No warnings can be incurred under -Werror (or -Xfatal-warnings)", NoSourcePosition)) |
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.
Otherwise LGTM
@@ -216,7 +216,6 @@ class CompilationTests { | |||
@Test def checkInitGlobal: Unit = { | |||
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal") | |||
val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings") |
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.
We should inline options
into compileFilesInDir("tests/init-global/pos", options,
6251697
to
e410ad4
Compare
e410ad4
to
ded027e
Compare
This uncovered a bug in To workaround this issue do package object H:
inline def inlined =
- G.valBinaryAPI2 +
+ // G.valBinaryAPI2 + // FIXME should error (now fails -Ycheck)
G.valBinaryAPI3 package J:
inline def inlined =
- I.valBinaryAPI2 +
+ // I.valBinaryAPI2 + // FIXME should error (now fails -Ycheck)
I.valBinaryAPI3 and update the checkfile. |
ded027e
to
35b0509
Compare
Final PR. Adds functionality that changes the behaviour of fatal-warnings - fixes #18634
PR 5/5 (merge consecutively, per Nicolas' suggestion
Split up version of #18829