Extract Function: Do not extract into lambda
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
fun bar(a: Int, b: Int) {
|
||||
val foo = { <selection>a + b</selection> - 1 }.invoke()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun bar(a: Int, b: Int) {
|
||||
fun i(): Int {
|
||||
return a + b
|
||||
}
|
||||
|
||||
val foo = { i() - 1 }.invoke()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
class A(val a: Int, b: Int) {
|
||||
val foo = { <selection>a + b</selection> - 1 }.invoke()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
class A(val a: Int, b: Int) {
|
||||
val foo = { i(b) - 1 }.invoke()
|
||||
|
||||
fun i(b: Int): Int {
|
||||
return a + b
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
val a = 1
|
||||
val b = 1
|
||||
val foo = { <selection>a + b</selection> - 1 }.invoke()
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
val a = 1
|
||||
val b = 1
|
||||
val foo = { i() - 1 }.invoke()
|
||||
|
||||
fun i(): Int {
|
||||
return a + b
|
||||
}
|
||||
Reference in New Issue
Block a user