Merge pull request #10247 from igfoo/igfoo/useSimpleType2

Kotlin: Remove another cast
This commit is contained in:
Ian Lynagh
2022-09-01 11:11:37 +01:00
committed by GitHub

View File

@@ -649,9 +649,9 @@ open class KotlinUsesExtractor(
(s.isBoxedArray && s.arguments.isNotEmpty()) || s.isPrimitiveArray() -> { (s.isBoxedArray && s.arguments.isNotEmpty()) || s.isPrimitiveArray() -> {
fun replaceComponentTypeWithAny(t: IrSimpleType, dimensions: Int): IrSimpleType = fun replaceComponentTypeWithAny(t: IrSimpleType, dimensions: Int): IrType =
if (dimensions == 0) if (dimensions == 0)
pluginContext.irBuiltIns.anyType as IrSimpleType pluginContext.irBuiltIns.anyType
else else
t.toBuilder().also { it.arguments = (it.arguments[0] as IrTypeProjection) t.toBuilder().also { it.arguments = (it.arguments[0] as IrTypeProjection)
.let { oldArg -> .let { oldArg ->
@@ -659,7 +659,7 @@ open class KotlinUsesExtractor(
} }
}.buildSimpleType() }.buildSimpleType()
var componentType = s.getArrayElementType(pluginContext.irBuiltIns) var componentType: IrType = s.getArrayElementType(pluginContext.irBuiltIns)
var isPrimitiveArray = false var isPrimitiveArray = false
var dimensions = 0 var dimensions = 0
var elementType: IrType = s var elementType: IrType = s