1 min readJan 3, 2019
You can do this with inline functions:
inline fun runTwice(code: () -> Unit) { code(); code() }
Now you can use runTwice
with both suspend and regular functions and compiler automatically infers the corresponding type.
You can do this with inline functions:
inline fun runTwice(code: () -> Unit) { code(); code() }
Now you can use runTwice
with both suspend and regular functions and compiler automatically infers the corresponding type.
Project Lead for the Kotlin Programming Language @JetBrains