[FIR] Add INLINE_PROPERTY_WITH_BACKING_FIELD diagnostic

This commit is contained in:
Andrey Zinovyev
2021-07-21 13:46:31 +03:00
committed by teamcityserver
parent 38cecf8b12
commit 46d1b63f70
10 changed files with 38 additions and 26 deletions
@@ -3185,6 +3185,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.INLINE_PROPERTY_WITH_BACKING_FIELD) { firDiagnostic ->
InlinePropertyWithBackingFieldImpl(
firDiagnostic as FirPsiDiagnostic,
token,
)
}
add(FirErrors.CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON) { firDiagnostic ->
CannotAllUnderImportFromSingletonImpl(
firDiagnostic.a,
@@ -2222,6 +2222,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = ReifiedTypeParameterInOverride::class
}
abstract class InlinePropertyWithBackingField : KtFirDiagnostic<KtDeclaration>() {
override val diagnosticClass get() = InlinePropertyWithBackingField::class
}
abstract class CannotAllUnderImportFromSingleton : KtFirDiagnostic<KtImportDirective>() {
override val diagnosticClass get() = CannotAllUnderImportFromSingleton::class
abstract val objectName: Name
@@ -3588,6 +3588,13 @@ internal class ReifiedTypeParameterInOverrideImpl(
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class InlinePropertyWithBackingFieldImpl(
firDiagnostic: FirPsiDiagnostic,
override val token: ValidityToken,
) : KtFirDiagnostic.InlinePropertyWithBackingField(), KtAbstractFirDiagnostic<KtDeclaration> {
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class CannotAllUnderImportFromSingletonImpl(
override val objectName: Name,
firDiagnostic: FirPsiDiagnostic,