@@ -541,6 +541,12 @@ open class KotlinUsesExtractor(
541
541
542
542
private fun useArrayType (arrayType : IrSimpleType , componentType : IrType , elementType : IrType , dimensions : Int , isPrimitiveArray : Boolean ): TypeResults {
543
543
544
+ val arrayClass = arrayType.classifier.owner
545
+ if (arrayClass !is IrClass ) {
546
+ error(" Unexpected owner type for array type: ${arrayClass.javaClass} " )
547
+ return extractErrorType()
548
+ }
549
+
544
550
// Ensure we extract Array<Int> as Integer[], not int[], for example:
545
551
fun nullableIfNotPrimitive (type : IrType ) = if (type.isPrimitiveType() && ! isPrimitiveArray) type.makeNullable() else type
546
552
@@ -557,7 +563,7 @@ open class KotlinUsesExtractor(
557
563
dimensions,
558
564
componentTypeResults.javaResult.id)
559
565
560
- extractClassSupertypes(arrayType.classifier.owner as IrClass , it, ExtractSupertypesMode .Specialised (arrayType.arguments))
566
+ extractClassSupertypes(arrayClass , it, ExtractSupertypesMode .Specialised (arrayType.arguments))
561
567
562
568
// array.length
563
569
val length = tw.getLabelFor<DbField >(" @\" field;{$it };length\" " )
@@ -582,7 +588,7 @@ open class KotlinUsesExtractor(
582
588
componentTypeResults.javaResult.signature + " []" ,
583
589
javaShortName)
584
590
585
- val arrayClassResult = useSimpleTypeClass(arrayType.classifier.owner as IrClass , arrayType.arguments, arrayType.hasQuestionMark)
591
+ val arrayClassResult = useSimpleTypeClass(arrayClass , arrayType.arguments, arrayType.hasQuestionMark)
586
592
return TypeResults (javaResult, arrayClassResult.kotlinResult)
587
593
}
588
594
0 commit comments