[FIR] Implement NO_RECEIVER_ALLOWED
This commit is contained in:
+6
@@ -321,6 +321,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.NO_RECEIVER_ALLOWED) { firDiagnostic ->
|
||||
NoReceiverAllowedImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic ->
|
||||
SuperIsNotAnExpressionImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
|
||||
+4
@@ -253,6 +253,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = IllegalSelector::class
|
||||
}
|
||||
|
||||
abstract class NoReceiverAllowed : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = NoReceiverAllowed::class
|
||||
}
|
||||
|
||||
abstract class SuperIsNotAnExpression : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = SuperIsNotAnExpression::class
|
||||
}
|
||||
|
||||
+7
@@ -374,6 +374,13 @@ internal class IllegalSelectorImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class NoReceiverAllowedImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.NoReceiverAllowed(), KtAbstractFirDiagnostic<PsiElement> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class SuperIsNotAnExpressionImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
|
||||
Reference in New Issue
Block a user