Drop usages of FirErrors.TYPE_PARAMETER_AS_SUPERTYPE

This commit is contained in:
Mikhail Glukhikh
2021-03-26 14:41:26 +03:00
committed by TeamCityServer
parent c74f471a82
commit 221b6bd184
8 changed files with 0 additions and 23 deletions
@@ -88,7 +88,6 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
}
val SUPERTYPES by object : DiagnosticGroup("Supertypes") {
val TYPE_PARAMETER_AS_SUPERTYPE by error<FirSourceElement, PsiElement>()
val ENUM_AS_SUPERTYPE by error<FirSourceElement, PsiElement>()
val RECURSION_IN_SUPERTYPES by error<FirSourceElement, PsiElement>()
val NOT_A_SUPERTYPE by error<FirSourceElement, PsiElement>()
@@ -92,7 +92,6 @@ object FirErrors {
val INSTANCE_ACCESS_BEFORE_SUPER_CALL by error1<FirSourceElement, PsiElement, String>()
// Supertypes
val TYPE_PARAMETER_AS_SUPERTYPE by error0<FirSourceElement, PsiElement>()
val ENUM_AS_SUPERTYPE by error0<FirSourceElement, PsiElement>()
val RECURSION_IN_SUPERTYPES by error0<FirSourceElement, PsiElement>()
val NOT_A_SUPERTYPE by error0<FirSourceElement, PsiElement>()
@@ -198,7 +198,6 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_MISMATCH
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETERS_IN_ENUM
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETERS_IN_OBJECT
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_AS_REIFIED
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_AS_SUPERTYPE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_IN_CATCH_CLAUSE
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_IS_NOT_AN_EXPRESSION
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_ON_LHS_OF_DOT
@@ -290,7 +289,6 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension {
)
// Supertypes
map.put(TYPE_PARAMETER_AS_SUPERTYPE, "Type parameter as supertype")
map.put(ENUM_AS_SUPERTYPE, "Enum as supertype")
map.put(RECURSION_IN_SUPERTYPES, "Recursion in supertypes")
map.put(NOT_A_SUPERTYPE, "Not an immediate supertype")
@@ -136,7 +136,6 @@ private fun ConeSimpleDiagnostic.getFactory(): FirDiagnosticFactory0<FirSourceEl
DiagnosticKind.IllegalUnderscore -> FirErrors.ILLEGAL_UNDERSCORE
DiagnosticKind.DeserializationError -> FirErrors.DESERIALIZATION_ERROR
DiagnosticKind.InferenceError -> FirErrors.INFERENCE_ERROR
DiagnosticKind.TypeParameterAsSupertype -> FirErrors.TYPE_PARAMETER_AS_SUPERTYPE
DiagnosticKind.EnumAsSupertype -> FirErrors.ENUM_AS_SUPERTYPE
DiagnosticKind.RecursionInSupertypes -> FirErrors.RECURSION_IN_SUPERTYPES
DiagnosticKind.RecursionInImplicitTypes -> FirErrors.RECURSION_IN_IMPLICIT_TYPES
@@ -21,7 +21,6 @@ enum class DiagnosticKind {
IllegalUnderscore,
DeserializationError,
InferenceError,
TypeParameterAsSupertype,
EnumAsSupertype,
RecursionInSupertypes,
RecursionInImplicitTypes,
@@ -200,12 +200,6 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.TYPE_PARAMETER_AS_SUPERTYPE) { firDiagnostic ->
TypeParameterAsSupertypeImpl(
firDiagnostic as FirPsiDiagnostic<*>,
token,
)
}
add(FirErrors.ENUM_AS_SUPERTYPE) { firDiagnostic ->
EnumAsSupertypeImpl(
firDiagnostic as FirPsiDiagnostic<*>,
@@ -157,10 +157,6 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
abstract val target: String
}
abstract class TypeParameterAsSupertype : KtFirDiagnostic<PsiElement>() {
override val diagnosticClass get() = TypeParameterAsSupertype::class
}
abstract class EnumAsSupertype : KtFirDiagnostic<PsiElement>() {
override val diagnosticClass get() = EnumAsSupertype::class
}
@@ -233,13 +233,6 @@ internal class InstanceAccessBeforeSuperCallImpl(
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
}
internal class TypeParameterAsSupertypeImpl(
firDiagnostic: FirPsiDiagnostic<*>,
override val token: ValidityToken,
) : KtFirDiagnostic.TypeParameterAsSupertype(), KtAbstractFirDiagnostic<PsiElement> {
override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic)
}
internal class EnumAsSupertypeImpl(
firDiagnostic: FirPsiDiagnostic<*>,
override val token: ValidityToken,