[FIR] Report MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES

^KT-59367 Fixed
This commit is contained in:
Nikolay Lunyak
2023-08-16 14:14:08 +03:00
committed by Space Team
parent b3e4099703
commit f674529558
33 changed files with 63 additions and 435 deletions
@@ -4665,6 +4665,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES) { firDiagnostic ->
MixingSuspendAndNonSuspendSupertypesImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.REDUNDANT_LABEL_WARNING) { firDiagnostic ->
RedundantLabelWarningImpl(
firDiagnostic as KtPsiDiagnostic,
@@ -3256,6 +3256,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = ReturnForBuiltInSuspend::class
}
interface MixingSuspendAndNonSuspendSupertypes : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = MixingSuspendAndNonSuspendSupertypes::class
}
interface RedundantLabelWarning : KtFirDiagnostic<KtLabelReferenceExpression> {
override val diagnosticClass get() = RedundantLabelWarning::class
}
@@ -3928,6 +3928,11 @@ internal class ReturnForBuiltInSuspendImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtReturnExpression>(firDiagnostic, token), KtFirDiagnostic.ReturnForBuiltInSuspend
internal class MixingSuspendAndNonSuspendSupertypesImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.MixingSuspendAndNonSuspendSupertypes
internal class RedundantLabelWarningImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,