File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
java/kotlin-extractor/src/main/kotlin Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -667,11 +667,15 @@ open class KotlinUsesExtractor(
667
667
dimensions++
668
668
if (elementType.isPrimitiveArray())
669
669
isPrimitiveArray = true
670
- if (((elementType as IrSimpleType ).arguments.singleOrNull() as ? IrTypeProjection )?.variance == Variance .IN_VARIANCE ) {
671
- // Because Java's arrays are covariant, Kotlin will render Array<in X> as Object[], Array<Array<in X>> as Object[][] etc.
672
- componentType = replaceComponentTypeWithAny(s, dimensions - 1 )
673
- elementType = pluginContext.irBuiltIns.anyType as IrSimpleType
674
- break
670
+ if (elementType is IrSimpleType ) {
671
+ if ((elementType.arguments.singleOrNull() as ? IrTypeProjection )?.variance == Variance .IN_VARIANCE ) {
672
+ // Because Java's arrays are covariant, Kotlin will render Array<in X> as Object[], Array<Array<in X>> as Object[][] etc.
673
+ componentType = replaceComponentTypeWithAny(s, dimensions - 1 )
674
+ elementType = pluginContext.irBuiltIns.anyType
675
+ break
676
+ }
677
+ } else {
678
+ logger.warn(" Unexpected element type representation ${elementType.javaClass} for ${s.render()} " )
675
679
}
676
680
elementType = elementType.getArrayElementType(pluginContext.irBuiltIns)
677
681
}
You can’t perform that action at this time.
0 commit comments