Extract Function: Support multi-declaration initializers

#KT-5613 Fixed
This commit is contained in:
Alexey Sedunov
2014-09-01 13:21:57 +04:00
parent b33e696ab7
commit e03bae44d9
7 changed files with 61 additions and 1 deletions
@@ -0,0 +1,17 @@
data class Pair<A, B>(val a: A, val b: B)
fun <A, B> A.to(b: B) = Pair(this, b)
// SIBLING:
fun foo() {
val (a, b) =
if (true) {
unit()
1 to 2
} else {
2 to 3
}
}
private fun unit() {
1 + 1
}