@@ -1116,12 +1116,18 @@ open class KotlinUsesExtractor(
1116
1116
javaLangClass?.let { jlc ->
1117
1117
return jlc.symbol.typeWithArguments(t.arguments)
1118
1118
}
1119
- } else if (t.isArray() || t.isNullableArray()) {
1120
- val elementType = t.getArrayElementType(pluginContext.irBuiltIns)
1121
- val replacedElementType = kClassToJavaClass(elementType)
1122
- if (replacedElementType != = elementType) {
1123
- val newArg = makeTypeProjection(replacedElementType, (t.arguments[0 ] as IrTypeProjection ).variance)
1124
- return t.classOrNull!! .typeWithArguments(listOf (newArg)).codeQlWithHasQuestionMark(t.isNullableArray())
1119
+ } else {
1120
+ t.classOrNull?.let { tCls ->
1121
+ if (t.isArray() || t.isNullableArray()) {
1122
+ (t.arguments.singleOrNull() as ? IrTypeProjection )?.let { elementTypeArg ->
1123
+ val elementType = elementTypeArg.type
1124
+ val replacedElementType = kClassToJavaClass(elementType)
1125
+ if (replacedElementType != = elementType) {
1126
+ val newArg = makeTypeProjection(replacedElementType, elementTypeArg.variance)
1127
+ return tCls.typeWithArguments(listOf (newArg)).codeQlWithHasQuestionMark(t.isNullableArray())
1128
+ }
1129
+ }
1130
+ }
1125
1131
}
1126
1132
}
1127
1133
}
@@ -1134,7 +1140,7 @@ open class KotlinUsesExtractor(
1134
1140
isAnnotationClassProperty(it)
1135
1141
} ? : false
1136
1142
1137
- fun isAnnotationClassProperty (p : IrPropertySymbol ) =
1143
+ private fun isAnnotationClassProperty (p : IrPropertySymbol ) =
1138
1144
p.owner.parentClassOrNull?.kind == ClassKind .ANNOTATION_CLASS
1139
1145
1140
1146
fun getAdjustedReturnType (f : IrFunction ) : IrType {
0 commit comments