FIR checker: report NOT_A_FUNCTION_LABEL
This commit is contained in:
committed by
TeamCityServer
parent
ab9a23cbfa
commit
5c716ea979
+6
@@ -3404,6 +3404,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.NOT_A_FUNCTION_LABEL) { firDiagnostic ->
|
||||
NotAFunctionLabelImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY) { firDiagnostic ->
|
||||
ReturnInFunctionWithExpressionBodyImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
|
||||
+4
@@ -2371,6 +2371,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = ReturnNotAllowed::class
|
||||
}
|
||||
|
||||
abstract class NotAFunctionLabel : KtFirDiagnostic<KtReturnExpression>() {
|
||||
override val diagnosticClass get() = NotAFunctionLabel::class
|
||||
}
|
||||
|
||||
abstract class ReturnInFunctionWithExpressionBody : KtFirDiagnostic<KtReturnExpression>() {
|
||||
override val diagnosticClass get() = ReturnInFunctionWithExpressionBody::class
|
||||
}
|
||||
|
||||
+5
@@ -2859,6 +2859,11 @@ internal class ReturnNotAllowedImpl(
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.ReturnNotAllowed(), KtAbstractFirDiagnostic<KtReturnExpression>
|
||||
|
||||
internal class NotAFunctionLabelImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.NotAFunctionLabel(), KtAbstractFirDiagnostic<KtReturnExpression>
|
||||
|
||||
internal class ReturnInFunctionWithExpressionBodyImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
|
||||
Reference in New Issue
Block a user