Extract Function: Generate variables when boxing multiline expressions

This commit is contained in:
Alexey Sedunov
2014-09-08 17:46:52 +04:00
parent 1a63f9b815
commit dd78ed6d4a
7 changed files with 41 additions and 29 deletions
@@ -17,8 +17,9 @@ fun foo(a: Int): Int {
private fun pair(a: Int, b: Int): Pair<Int, Int> {
var b1 = b
return Pair(if (a > 0) {
val i = if (a > 0) {
b1 += a
a + 1
} else a, b1)
} else a
return Pair(i, b1)
}