Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"

This reverts commit 84334b08
This commit is contained in:
Dmitriy Novozhilov
2021-06-03 09:48:50 +03:00
parent 20d1a84002
commit 796f8e6bce
51 changed files with 297 additions and 308 deletions
@@ -161,7 +161,7 @@ sealed class UnstableSmartCast(
class UnstableSmartCastResolutionError(
argument: ExpressionKotlinCallArgument,
targetType: UnwrappedType,
) : UnstableSmartCast(argument, targetType, UNSTABLE_SMARTCAST)
) : UnstableSmartCast(argument, targetType, MAY_THROW_RUNTIME_ERROR)
class UnstableSmartCastDiagnosticError(
argument: ExpressionKotlinCallArgument,
@@ -218,7 +218,7 @@ class ArgumentTypeMismatchDiagnostic(
val expectedType: UnwrappedType,
val actualType: UnwrappedType,
val expressionArgument: ExpressionKotlinCallArgument
) : KotlinCallDiagnostic(UNSTABLE_SMARTCAST) {
) : KotlinCallDiagnostic(MAY_THROW_RUNTIME_ERROR) {
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(UNSTABLE_SMARTCAST)
object UnstableSmartCastDiagnostic : ResolutionDiagnostic(MAY_THROW_RUNTIME_ERROR)
object HiddenExtensionRelatedToDynamicTypes : ResolutionDiagnostic(HIDDEN)
object HiddenDescriptor : ResolutionDiagnostic(HIDDEN)