[FIR] Implement FUNCTION_EXPECTED
This commit is contained in:
+8
@@ -327,6 +327,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.FUNCTION_EXPECTED) { firDiagnostic ->
|
||||
FunctionExpectedImpl(
|
||||
firDiagnostic.a,
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b),
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic ->
|
||||
SuperIsNotAnExpressionImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
|
||||
+6
@@ -257,6 +257,12 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NoReceiverAllowed::class
|
||||
}
|
||||
|
||||
abstract class FunctionExpected : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = FunctionExpected::class
|
||||
abstract val expression: String
|
||||
abstract val type: KtType
|
||||
}
|
||||
|
||||
abstract class SuperIsNotAnExpression : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = SuperIsNotAnExpression::class
|
||||
}
|
||||
|
||||
+9
@@ -381,6 +381,15 @@ internal class NoReceiverAllowedImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class FunctionExpectedImpl(
|
||||
override val expression: String,
|
||||
override val type: KtType,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.FunctionExpected(), 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