[FIR] Implement DANGEROUS_CHARACTERS
This commit is contained in:
+7
@@ -2883,6 +2883,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.DANGEROUS_CHARACTERS) { firDiagnostic ->
|
||||
DangerousCharactersImpl(
|
||||
firDiagnostic.a,
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.EQUALITY_NOT_APPLICABLE) { firDiagnostic ->
|
||||
EqualityNotApplicableImpl(
|
||||
firDiagnostic.a,
|
||||
|
||||
+5
@@ -2016,6 +2016,11 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract val message: String
|
||||
}
|
||||
|
||||
abstract class DangerousCharacters : KtFirDiagnostic<KtNamedDeclaration>() {
|
||||
override val diagnosticClass get() = DangerousCharacters::class
|
||||
abstract val characters: String
|
||||
}
|
||||
|
||||
abstract class EqualityNotApplicable : KtFirDiagnostic<KtBinaryExpression>() {
|
||||
override val diagnosticClass get() = EqualityNotApplicable::class
|
||||
abstract val operator: String
|
||||
|
||||
+8
@@ -3247,6 +3247,14 @@ internal class InvalidCharactersImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class DangerousCharactersImpl(
|
||||
override val characters: String,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.DangerousCharacters(), KtAbstractFirDiagnostic<KtNamedDeclaration> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class EqualityNotApplicableImpl(
|
||||
override val operator: String,
|
||||
override val leftType: KtType,
|
||||
|
||||
Reference in New Issue
Block a user