Suppress K2 specific warnings in the codebase

^KT-62472
This commit is contained in:
Dmitriy Novozhilov
2023-10-10 14:32:35 +03:00
committed by Space Team
parent 9e66a7b999
commit 704e2ef5c5
43 changed files with 58 additions and 8 deletions
@@ -421,6 +421,7 @@ class MethodInliner(
private fun getNewIndex(`var`: Int): Int {
val lambdaInfo = inliningContext.lambdaInfo
@Suppress("USELESS_IS_CHECK") // K2 warning suppression, TODO: KT-62472
if (reorderIrLambdaParameters && lambdaInfo is IrExpressionLambda) {
val extensionSize = if (lambdaInfo.isExtensionLambda) lambdaInfo.invokeMethod.argumentTypes[0].size else 0
return when {
@@ -48,6 +48,7 @@ fun classFileContainsMethod(descriptor: FunctionDescriptor, state: GenerationSta
(descriptor.containingDeclaration as DeserializedClassDescriptor).classId ?: return null
}
descriptor.containerSource is JvmPackagePartSource -> {
@Suppress("USELESS_CAST") // K2 warning suppression, TODO: KT-62472
(descriptor.containerSource as JvmPackagePartSource).classId
}
else -> {
@@ -610,6 +610,7 @@ class KotlinTypeMapper @JvmOverloads constructor(
val isAccessor = property is AccessorForPropertyDescriptor
val propertyName = if (isAccessor)
@Suppress("USELESS_CAST") // K2 warning suppression, TODO: KT-62472
(property as AccessorForPropertyDescriptor).accessorSuffix
else
property.name.asString()