fun returnNullable(): String? = null inline fun Array.matchAll(fn: (String) -> Unit) { for (string in this) { fn(returnNullable() ?: continue) } } fun Array.matchAll2(fn: (String) -> Unit) { matchAll(fn) } inline fun Array.matchAll3(crossinline fn: (String) -> Unit) { matchAll2 { fn(it) } } fun test(a: Array) { a.matchAll {} a.matchAll2 {} a.matchAll3 {} } fun box(): String { test(arrayOf("")) return "OK" }