FIR Java: fix conversion of primitive type
This commit is contained in:
committed by
TeamCityServer
parent
a12e31daf1
commit
020b6e9dd1
@@ -776,13 +776,22 @@ private fun FirConstExpression<*>.setProperType(session: FirSession): FirConstEx
|
|||||||
private fun JavaType.toFirResolvedTypeRef(
|
private fun JavaType.toFirResolvedTypeRef(
|
||||||
session: FirSession, javaTypeParameterStack: JavaTypeParameterStack
|
session: FirSession, javaTypeParameterStack: JavaTypeParameterStack
|
||||||
): FirResolvedTypeRef {
|
): FirResolvedTypeRef {
|
||||||
if (this is JavaClassifierType) return toFirResolvedTypeRef(
|
return when (this) {
|
||||||
session,
|
is JavaClassifierType -> toFirResolvedTypeRef(
|
||||||
javaTypeParameterStack,
|
session,
|
||||||
isForSupertypes = false,
|
javaTypeParameterStack,
|
||||||
forTypeParameterBounds = false
|
isForSupertypes = false,
|
||||||
)
|
forTypeParameterBounds = false
|
||||||
return buildResolvedTypeRef {
|
)
|
||||||
type = ConeClassErrorType(ConeSimpleDiagnostic("Unexpected JavaType: $this", DiagnosticKind.Java))
|
is JavaPrimitiveType -> buildResolvedTypeRef {
|
||||||
|
type = toConeKotlinTypeWithoutEnhancement(
|
||||||
|
session,
|
||||||
|
javaTypeParameterStack,
|
||||||
|
)
|
||||||
|
this@toFirResolvedTypeRef.annotations.mapTo(annotations) { it.toFirAnnotationCall(session, javaTypeParameterStack) }
|
||||||
|
}
|
||||||
|
else -> buildResolvedTypeRef {
|
||||||
|
type = ConeClassErrorType(ConeSimpleDiagnostic("Unexpected JavaType: ${this@toFirResolvedTypeRef}", DiagnosticKind.Java))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ public open class ClassObjectArrayInParam : R|kotlin/Any| {
|
|||||||
public constructor(vararg value: R|kotlin/Array<kotlin/reflect/KClass<*>>|): R|test/ClassObjectArrayInParam.Anno|
|
public constructor(vararg value: R|kotlin/Array<kotlin/reflect/KClass<*>>|): R|test/ClassObjectArrayInParam.Anno|
|
||||||
|
|
||||||
}
|
}
|
||||||
@R|test/ClassObjectArrayInParam.Anno|(<implicitArrayOf>(<getClass>(<getClass>(R|ft<test/ClassObjectArrayInParam, test/ClassObjectArrayInParam?>|)), <getClass>(<getClass>(R|ft<test/ClassObjectArrayInParam.Nested, test/ClassObjectArrayInParam.Nested?>|)), <getClass>(<getClass>(R|ft<kotlin/String, kotlin/String?>|)), <getClass>(<getClass>(R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|)), <getClass>(<getClass>(R|ERROR CLASS: Unexpected JavaType: org.jetbrains.kotlin.fir.types.builder.FirResolvedTypeRefBuilder@4abd3f24|)), <getClass>(<getClass>(R|ERROR CLASS: Unexpected JavaType: org.jetbrains.kotlin.fir.types.builder.FirResolvedTypeRefBuilder@6214f104|)), <getClass>(<getClass>(R|ERROR CLASS: Unexpected JavaType: org.jetbrains.kotlin.fir.types.builder.FirResolvedTypeRefBuilder@5450f4f|)))) public open class Nested : R|kotlin/Any| {
|
@R|test/ClassObjectArrayInParam.Anno|(<implicitArrayOf>(<getClass>(<getClass>(R|ft<test/ClassObjectArrayInParam, test/ClassObjectArrayInParam?>|)), <getClass>(<getClass>(R|ft<test/ClassObjectArrayInParam.Nested, test/ClassObjectArrayInParam.Nested?>|)), <getClass>(<getClass>(R|ft<kotlin/String, kotlin/String?>|)), <getClass>(<getClass>(R|ft<kotlin/collections/MutableList<kotlin/Any?>, kotlin/collections/List<*>?>|)), <getClass>(<getClass>(R|ERROR CLASS: Unexpected JavaType: JavaArrayTypeImpl: PsiType:String[][]|)), <getClass>(<getClass>(R|ERROR CLASS: Unexpected JavaType: JavaArrayTypeImpl: PsiType:int[][]|)), <getClass>(<getClass>(R|kotlin/Unit|)))) public open class Nested : R|kotlin/Any| {
|
||||||
public constructor(): R|test/ClassObjectArrayInParam.Nested|
|
public constructor(): R|test/ClassObjectArrayInParam.Nested|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user