@@ -239,8 +239,6 @@ open class KotlinUsesExtractor(
239
239
return UseClassInstanceResult (classTypeResult, extractClass)
240
240
}
241
241
242
- private fun isArray (t : IrSimpleType ) = t.isBoxedArray || t.isPrimitiveArray()
243
-
244
242
private fun extractClassLaterIfExternal (c : IrClass ) {
245
243
if (isExternalDeclaration(c)) {
246
244
extractExternalClassLater(c)
@@ -565,6 +563,8 @@ open class KotlinUsesExtractor(
565
563
Primitive arrays are represented as e.g. boolean[].
566
564
*/
567
565
566
+ private fun isArray (t : IrType ) = t.isBoxedArray || t.isPrimitiveArray()
567
+
568
568
data class ArrayInfo (val elementTypeResults : TypeResults ,
569
569
val componentTypeResults : TypeResults ,
570
570
val dimensions : Int )
@@ -579,7 +579,7 @@ open class KotlinUsesExtractor(
579
579
*/
580
580
private fun useArrayType (t : IrType , isPrimitiveArray : Boolean ): ArrayInfo {
581
581
582
- if (! t.isBoxedArray && ! t.isPrimitiveArray( )) {
582
+ if (! isArray(t )) {
583
583
val nullableT = if (t.isPrimitiveType() && ! isPrimitiveArray) t.makeNullable() else t
584
584
val typeResults = useType(nullableT)
585
585
return ArrayInfo (typeResults, typeResults, 0 )
@@ -1155,13 +1155,13 @@ open class KotlinUsesExtractor(
1155
1155
}
1156
1156
} else {
1157
1157
t.classOrNull?.let { tCls ->
1158
- if (t.isArray() || t.isNullableArray() ) {
1158
+ if (t.isBoxedArray ) {
1159
1159
(t.arguments.singleOrNull() as ? IrTypeProjection )?.let { elementTypeArg ->
1160
1160
val elementType = elementTypeArg.type
1161
1161
val replacedElementType = kClassToJavaClass(elementType)
1162
1162
if (replacedElementType != = elementType) {
1163
1163
val newArg = makeTypeProjection(replacedElementType, elementTypeArg.variance)
1164
- return tCls.typeWithArguments(listOf (newArg)).codeQlWithHasQuestionMark(t.isNullableArray ())
1164
+ return tCls.typeWithArguments(listOf (newArg)).codeQlWithHasQuestionMark(t.isNullable ())
1165
1165
}
1166
1166
}
1167
1167
}
@@ -1592,7 +1592,7 @@ open class KotlinUsesExtractor(
1592
1592
}
1593
1593
1594
1594
if (owner is IrClass ) {
1595
- if (t.isArray() || t.isNullableArray() ) {
1595
+ if (t.isBoxedArray ) {
1596
1596
val elementType = t.getArrayElementType(pluginContext.irBuiltIns)
1597
1597
val erasedElementType = erase(elementType)
1598
1598
return owner.typeWith(erasedElementType).codeQlWithHasQuestionMark(t.isNullable())
0 commit comments