Introduce Variable: Properly convert function body to block when needed

#KT-5353
This commit is contained in:
Alexey Sedunov
2014-12-22 14:26:37 +03:00
parent c73253259f
commit 6084352d37
7 changed files with 134 additions and 86 deletions
@@ -1,4 +1,8 @@
fun x(): Int {
val i = 1
println(i)
fun foo(a: Int): Int {
val i = a + 1
return if (a > 1) {
i * (a - 1)
} else {
a * i
}
}