[FIR] Support ENUM_CLASS_CONSTRUCTOR_CALL

^KT-59411 Fixed
This commit is contained in:
Nikolay Lunyak
2023-07-18 07:38:40 +03:00
committed by Space Team
parent f4ffd479cc
commit e4246e8f51
15 changed files with 46 additions and 55 deletions
@@ -863,6 +863,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.ENUM_CLASS_CONSTRUCTOR_CALL) { firDiagnostic ->
EnumClassConstructorCallImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.NOT_AN_ANNOTATION_CLASS) { firDiagnostic ->
NotAnAnnotationClassImpl(
firDiagnostic.a,
@@ -635,6 +635,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = AnnotationClassConstructorCall::class
}
interface EnumClassConstructorCall : KtFirDiagnostic<KtCallExpression> {
override val diagnosticClass get() = EnumClassConstructorCall::class
}
interface NotAnAnnotationClass : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = NotAnAnnotationClass::class
val annotationName: String
@@ -756,6 +756,11 @@ internal class AnnotationClassConstructorCallImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtCallExpression>(firDiagnostic, token), KtFirDiagnostic.AnnotationClassConstructorCall
internal class EnumClassConstructorCallImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtCallExpression>(firDiagnostic, token), KtFirDiagnostic.EnumClassConstructorCall
internal class NotAnAnnotationClassImpl(
override val annotationName: String,
firDiagnostic: KtPsiDiagnostic,