Partial body resolve: more efficient handling of loops

This commit is contained in:
Valentin Kipyatkov
2014-11-18 15:39:38 +03:00
parent 806bf3b942
commit 0a7d73ef6b
10 changed files with 128 additions and 3 deletions
@@ -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{}