[kotlin-dfa] Test for KTIJ-31635

GitOrigin-RevId: 18e8b35a237f588485edea8c6acf1b4945a50472
This commit is contained in:
Tagir Valeev
2024-11-14 18:47:29 +00:00
committed by intellij-monorepo-bot
parent e2107bdb35
commit 2f0b30cdc4
2 changed files with 8 additions and 0 deletions
@@ -82,6 +82,7 @@ class K2DataFlowInspectionTest : AbstractK2InspectionTest() {
fun testMath() = doTest()
fun testMembers() = doTest()
fun testNestedLoopLabel() = doTest()
fun testNestedThis() = doTest()
fun testNothingType() = doTest()
fun testPlatformType() {
// KTIJ-22430
@@ -0,0 +1,7 @@
// WITH_STDLIB
fun Int.test() {
val cond1 = this == 1
if (cond1 && <warning descr="Condition 'this > 0' is always true when reached">this > 0</warning>) {}
val cond2 = this.run { this == 1 }
if (cond1 && <warning descr="Condition 'cond2' is always true when reached">cond2</warning>) {}
}