damian
07/20/2017, 4:59 PMinline val fooFunction: () -> Unit
get() = { println("hello world") }
fun bar() {
fooFunction() // immediate invocation results in complete inlining of "println" body
}
I think this is a pretty obscure use case, but could see it being beneficial for something like funKTionale (using partial application, etc)dmitry.petrov
07/20/2017, 7:37 PMinline fun foo() = if (flag) { -> println("true") } else { println("false") }
In fact, I like the direction where it goes. We have some long-term plans for better compiler support of functional programming style. Most likely as a part of "JVM BE 2.0" that is currently in development.