FIR-IDE: add mappings for backing field diagnostics
This commit is contained in:
committed by
TeamCityServer
parent
510b9e6f2a
commit
70f462781a
+18
@@ -848,6 +848,24 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
|||||||
token,
|
token,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
add(FirErrors.BACKING_FIELD_IN_INTERFACE) { firDiagnostic ->
|
||||||
|
BackingFieldInInterfaceImpl(
|
||||||
|
firDiagnostic as FirPsiDiagnostic<*>,
|
||||||
|
token,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
add(FirErrors.EXTENSION_PROPERTY_WITH_BACKING_FIELD) { firDiagnostic ->
|
||||||
|
ExtensionPropertyWithBackingFieldImpl(
|
||||||
|
firDiagnostic as FirPsiDiagnostic<*>,
|
||||||
|
token,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
add(FirErrors.PROPERTY_INITIALIZER_NO_BACKING_FIELD) { firDiagnostic ->
|
||||||
|
PropertyInitializerNoBackingFieldImpl(
|
||||||
|
firDiagnostic as FirPsiDiagnostic<*>,
|
||||||
|
token,
|
||||||
|
)
|
||||||
|
}
|
||||||
add(FirErrors.ABSTRACT_DELEGATED_PROPERTY) { firDiagnostic ->
|
add(FirErrors.ABSTRACT_DELEGATED_PROPERTY) { firDiagnostic ->
|
||||||
AbstractDelegatedPropertyImpl(
|
AbstractDelegatedPropertyImpl(
|
||||||
firDiagnostic as FirPsiDiagnostic<*>,
|
firDiagnostic as FirPsiDiagnostic<*>,
|
||||||
|
|||||||
+12
@@ -602,6 +602,18 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
|
|||||||
override val diagnosticClass get() = PropertyWithNoTypeNoInitializer::class
|
override val diagnosticClass get() = PropertyWithNoTypeNoInitializer::class
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class BackingFieldInInterface : KtFirDiagnostic<KtProperty>() {
|
||||||
|
override val diagnosticClass get() = BackingFieldInInterface::class
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ExtensionPropertyWithBackingField : KtFirDiagnostic<KtExpression>() {
|
||||||
|
override val diagnosticClass get() = ExtensionPropertyWithBackingField::class
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class PropertyInitializerNoBackingField : KtFirDiagnostic<KtExpression>() {
|
||||||
|
override val diagnosticClass get() = PropertyInitializerNoBackingField::class
|
||||||
|
}
|
||||||
|
|
||||||
abstract class AbstractDelegatedProperty : KtFirDiagnostic<KtPropertyDelegate>() {
|
abstract class AbstractDelegatedProperty : KtFirDiagnostic<KtPropertyDelegate>() {
|
||||||
override val diagnosticClass get() = AbstractDelegatedProperty::class
|
override val diagnosticClass get() = AbstractDelegatedProperty::class
|
||||||
}
|
}
|
||||||
|
|||||||
+21
@@ -966,6 +966,27 @@ internal class PropertyWithNoTypeNoInitializerImpl(
|
|||||||
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal class BackingFieldInInterfaceImpl(
|
||||||
|
firDiagnostic: FirPsiDiagnostic<*>,
|
||||||
|
override val token: ValidityToken,
|
||||||
|
) : KtFirDiagnostic.BackingFieldInInterface(), KtAbstractFirDiagnostic<KtProperty> {
|
||||||
|
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ExtensionPropertyWithBackingFieldImpl(
|
||||||
|
firDiagnostic: FirPsiDiagnostic<*>,
|
||||||
|
override val token: ValidityToken,
|
||||||
|
) : KtFirDiagnostic.ExtensionPropertyWithBackingField(), KtAbstractFirDiagnostic<KtExpression> {
|
||||||
|
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class PropertyInitializerNoBackingFieldImpl(
|
||||||
|
firDiagnostic: FirPsiDiagnostic<*>,
|
||||||
|
override val token: ValidityToken,
|
||||||
|
) : KtFirDiagnostic.PropertyInitializerNoBackingField(), KtAbstractFirDiagnostic<KtExpression> {
|
||||||
|
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
|
||||||
|
}
|
||||||
|
|
||||||
internal class AbstractDelegatedPropertyImpl(
|
internal class AbstractDelegatedPropertyImpl(
|
||||||
firDiagnostic: FirPsiDiagnostic<*>,
|
firDiagnostic: FirPsiDiagnostic<*>,
|
||||||
override val token: ValidityToken,
|
override val token: ValidityToken,
|
||||||
|
|||||||
Reference in New Issue
Block a user