Check that "break" and "continue" do not produce false errors when using analyzeInContext
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
|
fun foo(): List<String> {
|
||||||
|
while (true) {
|
||||||
|
val result = ArrayList<String>()
|
||||||
|
<caret>for (s in list()) {
|
||||||
|
if (s.length > 0) {
|
||||||
|
result.add(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bar1()) continue
|
||||||
|
if (bar2()) break
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun list() = listOf("a")
|
||||||
|
fun bar1() = true
|
||||||
|
fun bar2() = true
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
|
fun foo(): List<String> {
|
||||||
|
while (true) {
|
||||||
|
<caret>val result = list().filter { it.length > 0 }
|
||||||
|
|
||||||
|
if (bar1()) continue
|
||||||
|
if (bar2()) break
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
return emptyList()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun list() = listOf("a")
|
||||||
|
fun bar1() = true
|
||||||
|
fun bar2() = true
|
||||||
Reference in New Issue
Block a user