[FIR] Add INLINE_SUSPEND_FUNCTION_TYPE_UNSUPPORTED diagnostic

This commit is contained in:
Andrey Zinovyev
2021-07-22 15:07:19 +03:00
committed by teamcityserver
parent b2f3485d7c
commit e56deb4525
9 changed files with 32 additions and 3 deletions
@@ -3211,6 +3211,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.INLINE_SUSPEND_FUNCTION_TYPE_UNSUPPORTED) { firDiagnostic ->
InlineSuspendFunctionTypeUnsupportedImpl(
firDiagnostic as FirPsiDiagnostic,
token,
)
}
add(FirErrors.CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON) { firDiagnostic ->
CannotAllUnderImportFromSingletonImpl(
firDiagnostic.a,
@@ -2240,6 +2240,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = IllegalInlineParameterModifier::class
}
abstract class InlineSuspendFunctionTypeUnsupported : KtFirDiagnostic<KtParameter>() {
override val diagnosticClass get() = InlineSuspendFunctionTypeUnsupported::class
}
abstract class CannotAllUnderImportFromSingleton : KtFirDiagnostic<KtImportDirective>() {
override val diagnosticClass get() = CannotAllUnderImportFromSingleton::class
abstract val objectName: Name
@@ -3618,6 +3618,13 @@ internal class IllegalInlineParameterModifierImpl(
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class InlineSuspendFunctionTypeUnsupportedImpl(
firDiagnostic: FirPsiDiagnostic,
override val token: ValidityToken,
) : KtFirDiagnostic.InlineSuspendFunctionTypeUnsupported(), KtAbstractFirDiagnostic<KtParameter> {
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class CannotAllUnderImportFromSingletonImpl(
override val objectName: Name,
firDiagnostic: FirPsiDiagnostic,