Partial body resolve: more efficient handling if-statements

This commit is contained in:
Valentin Kipyatkov
2014-11-18 15:48:03 +03:00
parent 0a7d73ef6b
commit e724af4b4e
6 changed files with 66 additions and 2 deletions
@@ -0,0 +1,3 @@
Resolve target: val x: kotlin.Any?
Skipped statements:
if (x == null) { print(1) if (f()) return }
@@ -0,0 +1,13 @@
fun foo() {
for (i in 1..10) {
val x = take()
if (x == null) {
print(1)
if (f()) return
}
<caret>x.hashCode()
}
}
fun take(): Any? = null
fun f(): Boolean{}
@@ -0,0 +1,3 @@
Resolve target: val x: kotlin.Any?
Skipped statements:
if (x == null) { print(1) if (f()) { return } else { print(2) } }
@@ -0,0 +1,18 @@
fun foo() {
for (i in 1..10) {
val x = take()
if (x == null) {
print(1)
if (f()) {
return
}
else {
print(2)
}
}
<caret>x.hashCode()
}
}
fun take(): Any? = null
fun f(): Boolean{}