mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
25 lines
328 B
Kotlin
Vendored
25 lines
328 B
Kotlin
Vendored
inline fun inlineFunVoid(f: () -> Unit): Unit {
|
|
return f()
|
|
}
|
|
|
|
inline fun coercedToUnit() {
|
|
inlineFunVoid {
|
|
var aa = 1
|
|
++aa
|
|
}
|
|
}
|
|
|
|
inline fun dup(f: () -> Unit): Unit {
|
|
f()
|
|
f()
|
|
}
|
|
|
|
fun test() {
|
|
dup { dup { dup { dup { dup {
|
|
dup { dup {
|
|
coercedToUnit()
|
|
}}}}}
|
|
}}
|
|
}
|
|
|
|
// 3 POP |