Code inliner: move lambda outside parentheses always when possible

So #KT-24215 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-05-23 12:16:40 +03:00
parent bb8c3495b8
commit 93a510c05b
6 changed files with 142 additions and 6 deletions
@@ -0,0 +1,24 @@
// "Replace with 'useSimple(simple(init))'" "true"
fun simple(param: Int = 0, init: () -> Unit): Int {
init()
return param
}
@Deprecated("Use useSimple instead", ReplaceWith("useSimple(simple(init))"))
fun use(init: () -> Unit): Int {
init()
return 0
}
fun useSimple(s: Int): Int {
return s
}
fun println(s: String) {}
fun useIt() {
val t = use<caret> {
println("abc")
}
}