Extract Function: Add support of initializer expressions

This commit is contained in:
Alexey Sedunov
2014-06-26 18:50:22 +04:00
parent 026bc05a86
commit 0c49d48a48
30 changed files with 302 additions and 12 deletions
@@ -0,0 +1,6 @@
// PARAM_TYPES: kotlin.Int
class A(val a: Int, b: Int) {
{
println(<selection>a + b</selection> - 1)
}
}
@@ -0,0 +1,10 @@
// PARAM_TYPES: kotlin.Int
class A(val a: Int, b: Int) {
{
println(i(b) - 1)
}
fun i(b: Int): Int {
return a + b
}
}
@@ -0,0 +1,3 @@
// PARAM_TYPES: kotlin.Int
val n = 1
class A(val a: Int, val b: Int = <selection>a + n</selection>)
@@ -0,0 +1,7 @@
// PARAM_TYPES: kotlin.Int
val n = 1
class A(val a: Int, val b: Int = i(a))
fun i(a: Int): Int {
return a + n
}