Kotlin: Silence compilation warnings

This commit is contained in:
Anders Fugmann
2025-12-04 16:12:24 +01:00
parent 772503bad8
commit bc419fd35c
3 changed files with 6 additions and 0 deletions

View File

@@ -415,6 +415,7 @@ open class KotlinFileExtractor(
private fun extractClassModifiers(c: IrClass, id: Label<out DbClassorinterface>) {
with("class modifiers", c) {
@Suppress("REDUNDANT_ELSE_IN_WHEN")
when (c.modality) {
Modality.FINAL -> addModifiers(id, "final")
Modality.SEALED -> addModifiers(id, "sealed")
@@ -2801,6 +2802,7 @@ open class KotlinFileExtractor(
private fun extractBody(b: IrBody, callable: Label<out DbCallable>) {
with("body", b) {
@Suppress("REDUNDANT_ELSE_IN_WHEN")
when (b) {
is IrBlockBody -> extractBlockBody(b, callable)
is IrSyntheticBody -> extractSyntheticBody(b, callable)

View File

@@ -1836,6 +1836,7 @@ open class KotlinUsesExtractor(
// Note this function doesn't return a signature because type arguments are never
// incorporated into function signatures.
@Suppress("REDUNDANT_ELSE_IN_WHEN")
return when (arg) {
is IrStarProjection -> {
val anyTypeLabel =

View File

@@ -111,6 +111,7 @@ private fun subProjectedType(
} ?: makeTypeProjection(t.substituteTypeArguments(substitutionMap), outerVariance)
private fun IrTypeArgument.upperBound(context: IrPluginContext) =
@Suppress("REDUNDANT_ELSE_IN_WHEN")
when (this) {
is IrStarProjection -> context.irBuiltIns.anyNType
is IrTypeProjection ->
@@ -125,6 +126,7 @@ private fun IrTypeArgument.upperBound(context: IrPluginContext) =
}
private fun IrTypeArgument.lowerBound(context: IrPluginContext) =
@Suppress("REDUNDANT_ELSE_IN_WHEN")
when (this) {
is IrStarProjection -> context.irBuiltIns.nothingType
is IrTypeProjection ->
@@ -209,6 +211,7 @@ fun IrClass.toRawType(): IrType {
}
fun IrTypeArgument.withQuestionMark(b: Boolean): IrTypeArgument =
@Suppress("REDUNDANT_ELSE_IN_WHEN")
when (this) {
is IrStarProjection -> this
is IrTypeProjection ->