Fix inaccurate report of DEPRECATED_ACCESS_TO_ENTRY_PROPERTY_FROM_ENUM
It can be reported not only from within the enum, but also from top-level functions. Add separate diagnostic for such cases. ^KT-64488
This commit is contained in:
committed by
Space Team
parent
34d87465ac
commit
02b5fed389
+6
@@ -5019,6 +5019,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.DEPRECATED_ACCESS_TO_ENTRIES_PROPERTY) { firDiagnostic ->
|
||||
DeprecatedAccessToEntriesPropertyImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.DEPRECATED_ACCESS_TO_ENUM_ENTRY_PROPERTY_AS_REFERENCE) { firDiagnostic ->
|
||||
DeprecatedAccessToEnumEntryPropertyAsReferenceImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+4
@@ -3494,6 +3494,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = DeprecatedAccessToEntryPropertyFromEnum::class
|
||||
}
|
||||
|
||||
interface DeprecatedAccessToEntriesProperty : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = DeprecatedAccessToEntriesProperty::class
|
||||
}
|
||||
|
||||
interface DeprecatedAccessToEnumEntryPropertyAsReference : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = DeprecatedAccessToEnumEntryPropertyAsReference::class
|
||||
}
|
||||
|
||||
+5
@@ -4214,6 +4214,11 @@ internal class DeprecatedAccessToEntryPropertyFromEnumImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.DeprecatedAccessToEntryPropertyFromEnum
|
||||
|
||||
internal class DeprecatedAccessToEntriesPropertyImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.DeprecatedAccessToEntriesProperty
|
||||
|
||||
internal class DeprecatedAccessToEnumEntryPropertyAsReferenceImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
|
||||
Reference in New Issue
Block a user