[FIR] Report DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE

^KT-59418 Fixed
This commit is contained in:
Nikolay Lunyak
2023-08-21 11:46:21 +03:00
committed by Space Team
parent 7d48a7934f
commit ed6a0af0a6
10 changed files with 60 additions and 1 deletions
@@ -408,6 +408,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.DUPLICATE_PARAMETER_NAME_IN_FUNCTION_TYPE) { firDiagnostic ->
DuplicateParameterNameInFunctionTypeImpl(
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS) { firDiagnostic ->
CreatingAnInstanceOfAbstractClassImpl(
firDiagnostic as KtPsiDiagnostic,
@@ -331,6 +331,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
val reference: String
}
interface DuplicateParameterNameInFunctionType : KtFirDiagnostic<KtTypeReference> {
override val diagnosticClass get() = DuplicateParameterNameInFunctionType::class
}
interface CreatingAnInstanceOfAbstractClass : KtFirDiagnostic<KtExpression> {
override val diagnosticClass get() = CreatingAnInstanceOfAbstractClass::class
}
@@ -381,6 +381,11 @@ internal class UnresolvedImportImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.UnresolvedImport
internal class DuplicateParameterNameInFunctionTypeImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtTypeReference>(firDiagnostic, token), KtFirDiagnostic.DuplicateParameterNameInFunctionType
internal class CreatingAnInstanceOfAbstractClassImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,