From a5e43c9e3ff5dd0a3c6cc54f2b1d7544849a96f6 Mon Sep 17 00:00:00 2001 From: Nikolay Lunyak Date: Wed, 28 Feb 2024 11:15:16 +0200 Subject: [PATCH] [FIR] Remove a strange check from `ArgumentInfo.smartCastType` Most probably it was there just to guarantee that if `argument` is not a smartcast expression then this property is exactly the same thing as `originalType`, but it seems there's not much point in that as none of the tests fail. --- .../fir/analysis/checkers/FirTypeCompatibilityHelpers.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirTypeCompatibilityHelpers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirTypeCompatibilityHelpers.kt index 86c2f570a35..1838c66f5ab 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirTypeCompatibilityHelpers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirTypeCompatibilityHelpers.kt @@ -88,9 +88,7 @@ internal class ArgumentInfo( val originalType: ConeKotlinType, val session: FirSession, ) { - val smartCastType: ConeKotlinType by lazy { - if (argument !is FirSmartCastExpression) originalType else userType.fullyExpandedType(session) - } + val smartCastType: ConeKotlinType by lazy { userType.fullyExpandedType(session) } val originalTypeInfo get() = originalType.toTypeInfo(session)