Lambda expressions (no closures yet).

This commit is contained in:
Dmitry Petrov
2016-08-26 11:29:51 +03:00
committed by Dmitry Petrov
parent 0b647ac358
commit 83c3bdd788
17 changed files with 285 additions and 36 deletions
@@ -0,0 +1,20 @@
object A
object B
interface IFoo {
val A.foo: B get() = B
}
interface IInvoke {
operator fun B.invoke() = 42
}
fun test(fooImpl: IFoo, invokeImpl: IInvoke) {
with(A) {
with(fooImpl) {
with(invokeImpl) {
foo()
}
}
}
}