[FIR] Add CAST_NEVER_SUCCEEDS
This commit is contained in:
committed by
TeamCityServer
parent
4ca757446a
commit
2b5524b18f
+6
@@ -3104,6 +3104,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.CAST_NEVER_SUCCEEDS) { firDiagnostic ->
|
||||
CastNeverSucceedsImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.USELESS_CAST) { firDiagnostic ->
|
||||
UselessCastImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+4
@@ -2173,6 +2173,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
abstract val type: KtType
|
||||
}
|
||||
|
||||
abstract class CastNeverSucceeds : KtFirDiagnostic<KtBinaryExpressionWithTypeRHS>() {
|
||||
override val diagnosticClass get() = CastNeverSucceeds::class
|
||||
}
|
||||
|
||||
abstract class UselessCast : KtFirDiagnostic<KtBinaryExpressionWithTypeRHS>() {
|
||||
override val diagnosticClass get() = UselessCast::class
|
||||
}
|
||||
|
||||
+7
@@ -2618,6 +2618,13 @@ internal class CannotCheckForErasedImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class CastNeverSucceedsImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.CastNeverSucceeds(), KtAbstractFirDiagnostic<KtBinaryExpressionWithTypeRHS> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class UselessCastImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
|
||||
Reference in New Issue
Block a user