mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] String literal within if-clause is subject to be re-analyzed
#KTIJ-25528 #KTIJ-20783 Fixed GitOrigin-RevId: 82db65b3450c1bdb1a031863853a4563273003db
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b23f0114de
commit
2713f97c5c
+1
-1
@@ -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, KtWhenCondition::class) == null
|
||||
it?.psi?.parentOfTypes(KtAnnotationEntry::class, KtIfExpression::class, KtWhenCondition::class) == null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
@@ -213,6 +213,11 @@ public class OutOfBlockModificationTestGenerated extends AbstractOutOfBlockModif
|
||||
runTest("testData/codeInsight/outOfBlock/InGlobalPropertyWithGetter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InIfCondition.kt")
|
||||
public void testInIfCondition() throws Exception {
|
||||
runTest("testData/codeInsight/outOfBlock/InIfCondition.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InKDocComment.kt")
|
||||
public void testInKDocComment() throws Exception {
|
||||
runTest("testData/codeInsight/outOfBlock/InKDocComment.kt");
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// OUT_OF_CODE_BLOCK: FALSE
|
||||
// ENABLE-WARNINGS
|
||||
|
||||
fun foo(count: Int): String {
|
||||
return if (count == 0) {
|
||||
"still zero"
|
||||
} else {
|
||||
"no longer zero!<caret>"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user