[FIR] Implement ILLEGAL_SELECTOR

This commit is contained in:
Ivan Kochurkin
2021-06-25 16:03:25 +03:00
parent a7276b25ae
commit 9f7a8c3948
16 changed files with 98 additions and 57 deletions
@@ -291,6 +291,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirErrors.ILLEGAL_SELECTOR) { firDiagnostic ->
IllegalSelectorImpl(
firDiagnostic as FirPsiDiagnostic,
token,
)
}
add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic ->
SuperIsNotAnExpressionImpl(
firDiagnostic as FirPsiDiagnostic,
@@ -226,6 +226,10 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
abstract val hasValueParameters: Boolean
}
abstract class IllegalSelector : KtFirDiagnostic<PsiElement>() {
override val diagnosticClass get() = IllegalSelector::class
}
abstract class SuperIsNotAnExpression : KtFirDiagnostic<PsiElement>() {
override val diagnosticClass get() = SuperIsNotAnExpression::class
}
@@ -338,6 +338,13 @@ internal class FunctionCallExpectedImpl(
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class IllegalSelectorImpl(
firDiagnostic: FirPsiDiagnostic,
override val token: ValidityToken,
) : KtFirDiagnostic.IllegalSelector(), KtAbstractFirDiagnostic<PsiElement> {
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class SuperIsNotAnExpressionImpl(
firDiagnostic: FirPsiDiagnostic,
override val token: ValidityToken,