diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/matchAndConvert.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/matchAndConvert.kt index 066dc170360..537cb6af8d8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/matchAndConvert.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/loopToCallChain/matchAndConvert.kt @@ -291,11 +291,9 @@ private fun checkSmartCastsPreserved(loop: KtForExpression, matchResult: MatchRe return true } finally { - if (smartCastCount > 0) { - loop.forEachDescendantOfType { - it.putCopyableUserData(SMARTCAST_KEY, null) - it.putCopyableUserData(IMPLICIT_RECEIVER_SMARTCAST_KEY, null) - } + loop.forEachDescendantOfType { + it.putCopyableUserData(SMARTCAST_KEY, null) + it.putCopyableUserData(IMPLICIT_RECEIVER_SMARTCAST_KEY, null) } } }