Lambda expressions (no closures yet).
This commit is contained in:
committed by
Dmitry Petrov
parent
0b647ac358
commit
83c3bdd788
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user