Skip to content

Commit 4db8bf1

Browse files
demiurg906Space Team
authored and
Space Team
committed
[CLI] Fix error mesage regargin mixed -Xsuppress-warning and -Xwarning-level
^KT-76957 Fixed
1 parent 143c464 commit 4db8bf1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArgumentsConfigurator.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,12 @@ open class CommonCompilerArgumentsConfigurator {
184184
}
185185
val existing = put(name, level)
186186
if (existing != null) {
187-
collector.report(
188-
CompilerMessageSeverity.ERROR,
187+
val message = if (name in suppressedDiagnostics) {
188+
"Severity of $name is configured both with -Xwarning-level and -Xsuppress-warning flags"
189+
} else {
189190
"-Xwarning-level is duplicated for warning $name"
190-
)
191+
}
192+
collector.report(CompilerMessageSeverity.ERROR, message)
191193
}
192194
}
193195
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
warning: argument "-Xsuppress-warning" is deprecated. Use "-Xwarning-level=UNCHECKED_CAST:disabled" instead
2-
error: -Xwarning-level is duplicated for warning UNCHECKED_CAST
2+
error: severity of UNCHECKED_CAST is configured both with -Xwarning-level and -Xsuppress-warning flags
33
COMPILATION_ERROR

0 commit comments

Comments
 (0)