[FIR] Add description to NO_ELSE_IN_WHEN and fill it for expect enum or sealed declarations

This commit is contained in:
Ivan Kochurkin
2023-07-19 18:40:39 +02:00
committed by Space Team
parent 8c39b2f71d
commit 529d5a1df2
7 changed files with 51 additions and 26 deletions
@@ -3822,6 +3822,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
firDiagnostic.a.map { whenMissingCase ->
whenMissingCase
},
firDiagnostic.b,
firDiagnostic as KtPsiDiagnostic,
token,
)
@@ -2670,6 +2670,7 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
interface NoElseInWhen : KtFirDiagnostic<KtWhenExpression> {
override val diagnosticClass get() = NoElseInWhen::class
val missingWhenCases: List<WhenMissingCase>
val description: String
}
interface NonExhaustiveWhenStatement : KtFirDiagnostic<KtWhenExpression> {
@@ -3217,6 +3217,7 @@ internal class ExpectedConditionImpl(
internal class NoElseInWhenImpl(
override val missingWhenCases: List<WhenMissingCase>,
override val description: String,
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtWhenExpression>(firDiagnostic, token), KtFirDiagnostic.NoElseInWhen