diff --git a/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/caches/trackers/PureKotlinCodeBlockModificationListener.kt b/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/caches/trackers/PureKotlinCodeBlockModificationListener.kt index 7c456ea5821b..7cc1b76255fb 100644 --- a/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/caches/trackers/PureKotlinCodeBlockModificationListener.kt +++ b/plugins/kotlin/base/analysis/src/org/jetbrains/kotlin/idea/caches/trackers/PureKotlinCodeBlockModificationListener.kt @@ -75,7 +75,7 @@ class PureKotlinCodeBlockModificationListener(val project: Project) : Disposable private inline fun isStringLiteralChange(changeSet: TreeChangeEvent): Boolean = isSpecificChange(changeSet) { it?.elementType == KtTokens.REGULAR_STRING_PART && - it?.psi?.parentOfTypes(KtAnnotationEntry::class, KtIfExpression::class, KtWhenCondition::class) == null + it?.psi?.parentOfTypes(KtAnnotationEntry::class, KtValVarKeywordOwner::class) == null } /** diff --git a/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InPropertyWithInferencePureStringLiteralChange.kt b/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InPropertyWithInferencePureStringLiteralChange.kt index 4a35f6718360..9af4679ccdea 100644 --- a/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InPropertyWithInferencePureStringLiteralChange.kt +++ b/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InPropertyWithInferencePureStringLiteralChange.kt @@ -1,4 +1,4 @@ -// OUT_OF_CODE_BLOCK: FALSE +// OUT_OF_CODE_BLOCK: TRUE class Test { val q = "aasdf" } diff --git a/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InWhenCondition.kt b/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InWhenCondition.kt index 728971337bc6..604208a0224d 100644 --- a/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InWhenCondition.kt +++ b/plugins/kotlin/idea/tests/testData/codeInsight/outOfBlock/InWhenCondition.kt @@ -4,7 +4,7 @@ fun foo(s: String): Int { return when (s) { "hello" -> 0 - "hello" -> 1 + "ello" -> 1 else -> 42 } } \ No newline at end of file