[FIR] Report UNSUPPORTED_SUSPEND_TEST

^KT-60002 Fixed
This commit is contained in:
Nikolay Lunyak
2023-08-07 11:43:53 +03:00
committed by Space Team
parent 223e590dcd
commit 921db9f8d4
11 changed files with 69 additions and 21 deletions
@@ -82,6 +82,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.UNSUPPORTED_SUSPEND_TEST) { firDiagnostic ->
UnsupportedSuspendTestImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.NEW_INFERENCE_ERROR) { firDiagnostic ->
NewInferenceErrorImpl(
firDiagnostic.a,
@@ -103,6 +103,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
val unsupportedFeature: Pair<LanguageFeature, LanguageVersionSettings>
}
interface UnsupportedSuspendTest : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = UnsupportedSuspendTest::class
}
interface NewInferenceError : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = NewInferenceError::class
val error: String
@@ -105,6 +105,11 @@ internal class UnsupportedFeatureImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.UnsupportedFeature
internal class UnsupportedSuspendTestImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.UnsupportedSuspendTest
internal class NewInferenceErrorImpl(
override val error: String,
firDiagnostic: KtPsiDiagnostic,