From 4cd7bf2ebbe4d66435c4ce6895195db249ce527b Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Fri, 26 Aug 2022 16:28:10 +0100 Subject: [PATCH] Kotlin: Small simplification Also removes a cast --- .../src/main/kotlin/KotlinUsesExtractor.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt index db25b2b84a7c..263b4fd4fb9b 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt @@ -1416,12 +1416,11 @@ open class KotlinUsesExtractor( for(t in subbedSupertypes) { when(t) { is IrSimpleType -> { - when (t.classifier.owner) { + val owner = t.classifier.owner + when (owner) { is IrClass -> { - val classifier: IrClassifierSymbol = t.classifier - val tcls: IrClass = classifier.owner as IrClass val typeArgs = if (t.arguments.isNotEmpty() && mode is ExtractSupertypesMode.Raw) null else t.arguments - val l = useClassInstance(tcls, typeArgs, inReceiverContext).typeResult.id + val l = useClassInstance(owner, typeArgs, inReceiverContext).typeResult.id tw.writeExtendsReftype(id, l) } else -> {