@@ -637,15 +637,23 @@ open class KotlinUsesExtractor(
637637 return TypeResults (javaResult, kotlinResult)
638638 }
639639
640+ val owner = s.classifier.owner
640641 val primitiveInfo = primitiveTypeMapping.getPrimitiveInfo(s)
641642
642643 when {
643- primitiveInfo != null -> return primitiveType(
644- s.classifier.owner as IrClass ,
645- primitiveInfo.primitiveName, primitiveInfo.otherIsPrimitive,
646- primitiveInfo.javaClass,
647- primitiveInfo.kotlinPackageName, primitiveInfo.kotlinClassName
648- )
644+ primitiveInfo != null -> {
645+ if (owner is IrClass ) {
646+ return primitiveType(
647+ owner,
648+ primitiveInfo.primitiveName, primitiveInfo.otherIsPrimitive,
649+ primitiveInfo.javaClass,
650+ primitiveInfo.kotlinPackageName, primitiveInfo.kotlinClassName
651+ )
652+ } else {
653+ logger.error(" Got primitive info for non-class (${owner.javaClass} ) for ${s.render()} " )
654+ return extractErrorType()
655+ }
656+ }
649657
650658 (s.isBoxedArray && s.arguments.isNotEmpty()) || s.isPrimitiveArray() -> {
651659
@@ -689,15 +697,13 @@ open class KotlinUsesExtractor(
689697 )
690698 }
691699
692- s.classifier.owner is IrClass -> {
693- val classifier: IrClassifierSymbol = s.classifier
694- val cls: IrClass = classifier.owner as IrClass
700+ owner is IrClass -> {
695701 val args = if (s.isRawType()) null else s.arguments
696702
697- return useSimpleTypeClass(cls , args, s.hasQuestionMark)
703+ return useSimpleTypeClass(owner , args, s.hasQuestionMark)
698704 }
699- s.classifier. owner is IrTypeParameter -> {
700- val javaResult = useTypeParameter(s.classifier. owner as IrTypeParameter )
705+ owner is IrTypeParameter -> {
706+ val javaResult = useTypeParameter(owner as IrTypeParameter )
701707 val aClassId = makeClass(" kotlin" , " TypeParam" ) // TODO: Wrong
702708 val kotlinResult = if (true ) TypeResult (fakeKotlinType(), " TODO" , " TODO" ) else
703709 if (s.hasQuestionMark) {
0 commit comments