mirror of
https://github.com/github/codeql.git
synced 2026-02-12 05:01:06 +01:00
Kotlin: Silence compilation warnings
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
Reference in New Issue
Block a user