Partial body resolve: more efficient handling of loops
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
Resolve target: val x: kotlin.Any?
|
||||
Skipped statements:
|
||||
if (x == null) { do { if (g()) break } while (f()) }
|
||||
@@ -0,0 +1,15 @@
|
||||
fun foo() {
|
||||
for (i in 1..10) {
|
||||
val x = take()
|
||||
if (x == null) {
|
||||
do {
|
||||
if (g()) break
|
||||
} while (f())
|
||||
}
|
||||
<caret>x.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
fun take(): Any? = null
|
||||
fun f(): Boolean{}
|
||||
fun g(): Boolean{}
|
||||
@@ -0,0 +1,3 @@
|
||||
Resolve target: val x: kotlin.Any?
|
||||
Skipped statements:
|
||||
if (x == null) { for (s in c) { print(s) return } }
|
||||
@@ -0,0 +1,14 @@
|
||||
fun foo(c: Collection<String>) {
|
||||
for (i in 1..10) {
|
||||
val x = take()
|
||||
if (x == null) {
|
||||
for (s in c) {
|
||||
print(s)
|
||||
return
|
||||
}
|
||||
}
|
||||
<caret>x.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
fun take(): Any? = null
|
||||
@@ -0,0 +1,3 @@
|
||||
Resolve target: val x: kotlin.Any?
|
||||
Skipped statements:
|
||||
if (x == null) { while (true) { if (g()) break } }
|
||||
@@ -0,0 +1,15 @@
|
||||
fun foo() {
|
||||
for (i in 1..10) {
|
||||
val x = take()
|
||||
if (x == null) {
|
||||
while (true) {
|
||||
if (g()) break
|
||||
}
|
||||
}
|
||||
<caret>x.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
fun take(): Any? = null
|
||||
fun f(): Boolean{}
|
||||
fun g(): Boolean{}
|
||||
@@ -0,0 +1,3 @@
|
||||
Resolve target: val x: kotlin.Any?
|
||||
Skipped statements:
|
||||
if (x == null) { while (f()) { print(1) return } }
|
||||
@@ -0,0 +1,15 @@
|
||||
fun foo() {
|
||||
for (i in 1..10) {
|
||||
val x = take()
|
||||
if (x == null) {
|
||||
while (f()) {
|
||||
print(1)
|
||||
return
|
||||
}
|
||||
}
|
||||
<caret>x.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
fun take(): Any? = null
|
||||
fun f(): Boolean{}
|
||||
Reference in New Issue
Block a user