August 2017
Intermediate to advanced
440 pages
10h
English
The noinline modifier is for function type parameters. It makes a specific argument be treated as a normal function type parameter (its calls are not replaced with the function literal body). Let's look at a noinline example:
fun boo(f: ()->Unit) {
//...
}
inline fun foo(before: ()->Unit, noinline f: () -> Unit) { // 1
before() // 2
boo (f) // 3
}
Two main reasons to use the noinline modifier are as follows:
Read now
Unlock full access