FIR: Fix exception caused by empty supertypes of java.lang.Object
This commit is contained in:
committed by
TeamCityServer
parent
7eb0fd4762
commit
9d9f191f51
@@ -33,15 +33,13 @@ import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.ConeFlexibleType
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef
|
||||
import org.jetbrains.kotlin.fir.types.constructClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl
|
||||
import org.jetbrains.kotlin.load.java.JavaClassFinder
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
import org.jetbrains.kotlin.load.java.structure.*
|
||||
import org.jetbrains.kotlin.load.java.structure.impl.JavaElementImpl
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.name.*
|
||||
import org.jetbrains.kotlin.types.Variance.INVARIANT
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
|
||||
@@ -195,6 +193,13 @@ class FirJavaFacade(
|
||||
}
|
||||
}
|
||||
javaClass.supertypes.mapTo(superTypeRefs) { it.toFirJavaTypeRef(session, javaTypeParameterStack) }
|
||||
if (superTypeRefs.isEmpty()) {
|
||||
superTypeRefs.add(
|
||||
buildResolvedTypeRef {
|
||||
type = StandardClassIds.Any.constructClassLikeType(emptyArray(), isNullable = false)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
val dispatchReceiver = classId.defaultType(typeParameters.map { it.symbol })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user