Revert "FIR: do not eagerly resolve class references in imported annotations"

This reverts commit 1a57d60f
This commit is contained in:
Mikhail Glukhikh
2021-03-15 18:36:13 +03:00
parent 83a4b6396a
commit e7129329d2
2 changed files with 15 additions and 3 deletions
@@ -641,7 +641,7 @@ internal fun JavaAnnotationArgument.toFirExpression(
is JavaClassObjectAnnotationArgument -> buildGetClassCall {
argumentList = buildUnaryArgumentList(
buildClassReferenceExpression {
classTypeRef = getReferencedType().toFirJavaTypeRef(session, javaTypeParameterStack)
classTypeRef = getReferencedType().toFirResolvedTypeRef(session, javaTypeParameterStack)
}
)
}
@@ -704,3 +704,17 @@ 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))
}
}