File tree 2 files changed +8
-1
lines changed
src/dotty/tools/dotc/reporting
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,13 @@ trait Reporting { this: Context =>
50
50
51
51
def reportWarning (warning : Warning ): Unit =
52
52
if (! this .settings.silentWarnings.value) {
53
- if (this .settings.XfatalWarnings .value) reporter.report(warning.toError)
53
+ if (this .settings.XfatalWarnings .value)
54
+ warning match {
55
+ case warning : ConditionalWarning if ! warning.enablingOption.value =>
56
+ reporter.report(warning) // conditional warnings that are not enabled are not fatal
57
+ case _ =>
58
+ reporter.report(warning.toError)
59
+ }
54
60
else reporter.report(warning)
55
61
}
56
62
Original file line number Diff line number Diff line change @@ -162,6 +162,7 @@ class CompilationTests extends ParallelTesting {
162
162
compileFile(" tests/neg-custom-args/i3882.scala" , allowDeepSubtypes) +
163
163
compileFile(" tests/neg-custom-args/i4372.scala" , allowDeepSubtypes) +
164
164
compileFile(" tests/neg-custom-args/i1754.scala" , allowDeepSubtypes) +
165
+ compileFile(" tests/neg-custom-args/conditionalWarnings.scala" , allowDeepSubtypes.and(" -deprecation" ).and(" -Xfatal-warnings" )) +
165
166
compileFilesInDir(" tests/neg-custom-args/isInstanceOf" , allowDeepSubtypes and " -Xfatal-warnings" ) +
166
167
compileFile(" tests/neg-custom-args/i3627.scala" , allowDeepSubtypes) +
167
168
compileFile(" tests/neg-custom-args/matchtype-loop.scala" , allowDeepSubtypes) +
You can’t perform that action at this time.
0 commit comments