KT-10903 Lambda to callable reference: use named arguments if needed, lift restriction about parameter default values

(cherry picked from commit 5232af5)
This commit is contained in:
Mikhail Glukhikh
2016-07-18 13:00:09 +03:00
committed by Mikhail Glukhikh
parent a979c7e1d7
commit 299097d112
10 changed files with 82 additions and 15 deletions
@@ -0,0 +1,7 @@
class Transformer {
fun transform(x: Int = 0, y: Int = 1, f: (Int) -> Int) = f(x + y)
}
fun bar(x: Int) = x * x
val y = Transformer().transform(y = 3, f = ::bar)