Kotlin: Be more permissive

I think we'll end up giving a warning/error later, but that's better
than having a cast throw now.
This commit is contained in:
Ian Lynagh
2022-08-31 18:09:36 +01:00
parent 86034dc602
commit e4ff25099b

View File

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