FIR: do not eagerly resolve class references in imported annotations

This commit is contained in:
pyos
2021-03-12 11:31:43 +01:00
committed by TeamCityServer
parent e630e00e99
commit 1a57d60f68
2 changed files with 3 additions and 15 deletions
@@ -641,7 +641,7 @@ internal fun JavaAnnotationArgument.toFirExpression(
is JavaClassObjectAnnotationArgument -> buildGetClassCall {
argumentList = buildUnaryArgumentList(
buildClassReferenceExpression {
classTypeRef = getReferencedType().toFirResolvedTypeRef(session, javaTypeParameterStack)
classTypeRef = getReferencedType().toFirJavaTypeRef(session, javaTypeParameterStack)
}
)
}
@@ -704,17 +704,3 @@ private fun FirConstExpression<*>.setProperType(session: FirSession): FirConstEx
replaceTypeRef(typeRef)
return this
}
private fun JavaType.toFirResolvedTypeRef(
session: FirSession, javaTypeParameterStack: JavaTypeParameterStack
): FirResolvedTypeRef {
if (this is JavaClassifierType) return toFirResolvedTypeRef(
session,
javaTypeParameterStack,
isForSupertypes = false,
forTypeParameterBounds = false
)
return buildResolvedTypeRef {
type = ConeClassErrorType(ConeSimpleDiagnostic("Unexpected JavaType: $this", DiagnosticKind.Java))
}
}