mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin-dfa] Fix downTo and testdata
GitOrigin-RevId: b5913b63bac70853f647717e5c852b47b1b49757
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a1ba795a7d
commit
3ec8bacbca
+1
-1
@@ -576,7 +576,7 @@ class KtControlFlowBuilder(val factory: DfaValueFactory, val context: KtExpressi
|
||||
val (leftRelation, rightRelation) = when(ref) {
|
||||
".." -> RelationType.GE to RelationType.LE
|
||||
"until" -> RelationType.GE to RelationType.LT
|
||||
"downTo" -> RelationType.LE to RelationType.GT
|
||||
"downTo" -> RelationType.LE to RelationType.GE
|
||||
else -> null to null
|
||||
}
|
||||
if (leftRelation != null && rightRelation != null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// PROBLEM: Condition is always false
|
||||
// FIX: none
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
for(i in 1 until 10) {
|
||||
if (<caret>i >= 10) {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// PROBLEM: 'for' range is always empty
|
||||
// FIX: none
|
||||
fun test(x: Int, y: Int) {
|
||||
if (y > x) return
|
||||
if (y >= x) return
|
||||
for(i in <caret>x..y) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ fun test(obj : Int) {
|
||||
when (obj) {
|
||||
in 0 until 10 -> {}
|
||||
<caret>!in 0..9 -> {}
|
||||
20 -> {}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user