mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 15:53:49 +00:00
26 lines
361 B
Kotlin
Vendored
26 lines
361 B
Kotlin
Vendored
package inlineFun1
|
|
|
|
inline fun myFun(crossinline f: () -> Int): Int {
|
|
val o = object {
|
|
fun test() = 1
|
|
}
|
|
o.test()
|
|
|
|
val lambda = { 1 }
|
|
lambda()
|
|
|
|
val o2 = object {
|
|
fun test() = f()
|
|
}
|
|
o2.test()
|
|
|
|
val lambda2 = { f() }
|
|
lambda2()
|
|
|
|
val ref = ::reference
|
|
ref.invoke()
|
|
|
|
return f()
|
|
}
|
|
|
|
fun reference() = 1 |