[FIR] Rename DUPLICATE_LABEL_IN_WHEN to DUPLICATE_BRANCH_CONDITION_IN_WHEN

... and fix the message

#KT-35289 Fixed
This commit is contained in:
Kirill Rakhman
2023-12-21 16:21:01 +01:00
committed by Space Team
parent 28eb78fe16
commit 8aa32d9f45
12 changed files with 117 additions and 28 deletions
@@ -4245,8 +4245,8 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.DUPLICATE_LABEL_IN_WHEN) { firDiagnostic ->
DuplicateLabelInWhenImpl(
add(FirErrors.DUPLICATE_BRANCH_CONDITION_IN_WHEN) { firDiagnostic ->
DuplicateBranchConditionInWhenImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
@@ -2958,8 +2958,8 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = CommaInWhenConditionWithoutArgument::class
}
interface DuplicateLabelInWhen : KtFirDiagnostic<KtElement> {
override val diagnosticClass get() = DuplicateLabelInWhen::class
interface DuplicateBranchConditionInWhen : KtFirDiagnostic<KtElement> {
override val diagnosticClass get() = DuplicateBranchConditionInWhen::class
}
interface ConfusingBranchConditionError : KtFirDiagnostic<PsiElement> {
@@ -3563,10 +3563,10 @@ internal class CommaInWhenConditionWithoutArgumentImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.CommaInWhenConditionWithoutArgument
internal class DuplicateLabelInWhenImpl(
internal class DuplicateBranchConditionInWhenImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.DuplicateLabelInWhen
) : KtAbstractFirDiagnostic<KtElement>(firDiagnostic, token), KtFirDiagnostic.DuplicateBranchConditionInWhen
internal class ConfusingBranchConditionErrorImpl(
firDiagnostic: KtPsiDiagnostic,