FIR checkers: report SMARTCAST_IMPOSSIBLE

This commit is contained in:
Tianyu Geng
2021-05-08 20:51:02 -07:00
committed by Dmitriy Novozhilov
parent 62f7e8f71f
commit 84334b087c
51 changed files with 308 additions and 297 deletions
@@ -161,7 +161,7 @@ sealed class UnstableSmartCast(
class UnstableSmartCastResolutionError(
argument: ExpressionKotlinCallArgument,
targetType: UnwrappedType,
) : UnstableSmartCast(argument, targetType, MAY_THROW_RUNTIME_ERROR)
) : UnstableSmartCast(argument, targetType, UNSTABLE_SMARTCAST)
class UnstableSmartCastDiagnosticError(
argument: ExpressionKotlinCallArgument,
@@ -218,7 +218,7 @@ class ArgumentTypeMismatchDiagnostic(
val expectedType: UnwrappedType,
val actualType: UnwrappedType,
val expressionArgument: ExpressionKotlinCallArgument
) : KotlinCallDiagnostic(MAY_THROW_RUNTIME_ERROR) {
) : KotlinCallDiagnostic(UNSTABLE_SMARTCAST) {
override fun report(reporter: DiagnosticReporter) {
reporter.onCallArgument(expressionArgument, this)
}
@@ -120,7 +120,7 @@ object ErrorDescriptorDiagnostic : ResolutionDiagnostic(RESOLVED) // todo discus
object LowPriorityDescriptorDiagnostic : ResolutionDiagnostic(RESOLVED_LOW_PRIORITY)
object DynamicDescriptorDiagnostic : ResolutionDiagnostic(RESOLVED_LOW_PRIORITY)
object ResolvedUsingNewFeatures : ResolutionDiagnostic(RESOLVED_NEED_PRESERVE_COMPATIBILITY)
object UnstableSmartCastDiagnostic : ResolutionDiagnostic(MAY_THROW_RUNTIME_ERROR)
object UnstableSmartCastDiagnostic : ResolutionDiagnostic(UNSTABLE_SMARTCAST)
object HiddenExtensionRelatedToDynamicTypes : ResolutionDiagnostic(HIDDEN)
object HiddenDescriptor : ResolutionDiagnostic(HIDDEN)