From d2a5281d94ed6655290d37f345df932f464e8d25 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 26 Aug 2022 15:59:26 +0100 Subject: [PATCH] Kotlin: Remove another cast --- .../src/main/kotlin/KotlinUsesExtractor.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt index db25b2b84a7..2eb564c2695 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt @@ -1459,13 +1459,13 @@ open class KotlinUsesExtractor( return eraseTypeParameter(owner) } - if (t.isArray() || t.isNullableArray()) { - val elementType = t.getArrayElementType(pluginContext.irBuiltIns) - val erasedElementType = erase(elementType) - return (classifier as IrClassSymbol).typeWith(erasedElementType).codeQlWithHasQuestionMark(t.hasQuestionMark) - } - if (owner is IrClass) { + if (t.isArray() || t.isNullableArray()) { + val elementType = t.getArrayElementType(pluginContext.irBuiltIns) + val erasedElementType = erase(elementType) + return owner.typeWith(erasedElementType).codeQlWithHasQuestionMark(t.hasQuestionMark) + } + return if (t.arguments.isNotEmpty()) t.addAnnotations(listOf(RawTypeAnnotation.annotationConstructor)) else