[FIR] Introduce OPERATOR_CALL_ON_CONSTRUCTOR diagnostic
#KT-59943
This commit is contained in:
committed by
Space Team
parent
649bbcf35f
commit
f4d18da6a0
+7
@@ -1636,6 +1636,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.OPERATOR_CALL_ON_CONSTRUCTOR) { firDiagnostic ->
|
||||
OperatorCallOnConstructorImpl(
|
||||
firDiagnostic.a,
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.INFIX_MODIFIER_REQUIRED) { firDiagnostic ->
|
||||
InfixModifierRequiredImpl(
|
||||
firSymbolBuilder.functionLikeBuilder.buildFunctionSymbol(firDiagnostic.a),
|
||||
|
||||
+5
@@ -1182,6 +1182,11 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
val name: String
|
||||
}
|
||||
|
||||
interface OperatorCallOnConstructor : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = OperatorCallOnConstructor::class
|
||||
val name: String
|
||||
}
|
||||
|
||||
interface InfixModifierRequired : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = InfixModifierRequired::class
|
||||
val functionSymbol: KtFunctionLikeSymbol
|
||||
|
||||
+6
@@ -1414,6 +1414,12 @@ internal class OperatorModifierRequiredImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.OperatorModifierRequired
|
||||
|
||||
internal class OperatorCallOnConstructorImpl(
|
||||
override val name: String,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.OperatorCallOnConstructor
|
||||
|
||||
internal class InfixModifierRequiredImpl(
|
||||
override val functionSymbol: KtFunctionLikeSymbol,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
|
||||
Reference in New Issue
Block a user