[FIR] Add REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE diagnostic

This commit is contained in:
Andrey Zinovyev
2021-07-22 15:33:00 +03:00
committed by teamcityserver
parent e56deb4525
commit c46a393a19
10 changed files with 34 additions and 48 deletions
@@ -3217,6 +3217,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE) { firDiagnostic ->
RedundantInlineSuspendFunctionTypeImpl(
firDiagnostic as FirPsiDiagnostic,
token,
)
}
add(FirErrors.CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON) { firDiagnostic ->
CannotAllUnderImportFromSingletonImpl(
firDiagnostic.a,
@@ -2244,6 +2244,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = InlineSuspendFunctionTypeUnsupported::class
}
abstract class RedundantInlineSuspendFunctionType : KtFirDiagnostic<KtElement>() {
override val diagnosticClass get() = RedundantInlineSuspendFunctionType::class
}
abstract class CannotAllUnderImportFromSingleton : KtFirDiagnostic<KtImportDirective>() {
override val diagnosticClass get() = CannotAllUnderImportFromSingleton::class
abstract val objectName: Name
@@ -3625,6 +3625,13 @@ internal class InlineSuspendFunctionTypeUnsupportedImpl(
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class RedundantInlineSuspendFunctionTypeImpl(
firDiagnostic: FirPsiDiagnostic,
override val token: ValidityToken,
) : KtFirDiagnostic.RedundantInlineSuspendFunctionType(), KtAbstractFirDiagnostic<KtElement> {
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class CannotAllUnderImportFromSingletonImpl(
override val objectName: Name,
firDiagnostic: FirPsiDiagnostic,