@@ -637,15 +637,23 @@ open class KotlinUsesExtractor(
637
637
return TypeResults (javaResult, kotlinResult)
638
638
}
639
639
640
+ val owner = s.classifier.owner
640
641
val primitiveInfo = primitiveTypeMapping.getPrimitiveInfo(s)
641
642
642
643
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
+ }
649
657
650
658
(s.isBoxedArray && s.arguments.isNotEmpty()) || s.isPrimitiveArray() -> {
651
659
@@ -689,15 +697,13 @@ open class KotlinUsesExtractor(
689
697
)
690
698
}
691
699
692
- s.classifier.owner is IrClass -> {
693
- val classifier: IrClassifierSymbol = s.classifier
694
- val cls: IrClass = classifier.owner as IrClass
700
+ owner is IrClass -> {
695
701
val args = if (s.isRawType()) null else s.arguments
696
702
697
- return useSimpleTypeClass(cls , args, s.hasQuestionMark)
703
+ return useSimpleTypeClass(owner , args, s.hasQuestionMark)
698
704
}
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 )
701
707
val aClassId = makeClass(" kotlin" , " TypeParam" ) // TODO: Wrong
702
708
val kotlinResult = if (true ) TypeResult (fakeKotlinType(), " TODO" , " TODO" ) else
703
709
if (s.hasQuestionMark) {
0 commit comments