From 77064c793717086e90d65be6e807bd2956be5058 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 10 Aug 2016 17:59:18 +0300 Subject: [PATCH] Fixed bug with user data not cleared --- .../idea/intentions/loopToCallChain/matchAndConvert.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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) } } }