KT-13941 related: "Simplify using destructuring declaration" is now applicable for function literals without parameter specification
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
data class XY(val x: String, val y: String)
|
||||
|
||||
fun convert(xy: XY, foo: (XY) -> String) = foo(xy)
|
||||
|
||||
fun foo(xy: XY) = convert<caret>(xy) { it.x + it.y }
|
||||
@@ -0,0 +1,5 @@
|
||||
data class XY(val x: String, val y: String)
|
||||
|
||||
fun convert(xy: XY, foo: (XY) -> String) = foo(xy)
|
||||
|
||||
fun foo(xy: XY) = convert(xy) <caret>{ it.x + it.y }
|
||||
@@ -0,0 +1,5 @@
|
||||
data class XY(val x: String, val y: String)
|
||||
|
||||
fun convert(xy: XY, foo: (XY) -> String) = foo(xy)
|
||||
|
||||
fun foo(xy: XY) = convert(xy) { (x, y) -> x + y }
|
||||
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
data class XY(val x: String, val y: String)
|
||||
|
||||
fun convert(xy: XY, foo: (XY) -> Unit) = foo(xy)
|
||||
|
||||
fun foo(xy: XY) = convert(xy) <caret>{
|
||||
val x = it.x
|
||||
val y = it.y
|
||||
println(x + y)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
data class XY(val x: String, val y: String)
|
||||
|
||||
fun convert(xy: XY, foo: (XY) -> Unit) = foo(xy)
|
||||
|
||||
fun foo(xy: XY) = convert(xy) {
|
||||
(x, y) ->
|
||||
println(x + y)
|
||||
}
|
||||
Reference in New Issue
Block a user