Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinJVM bytecode for inline functionsSingle-choice MCQ

Why can a `return` statement inside a lambda passed to an `inline` function perform a non-local return out of the enclosing function, and what bytecode-level fact makes this possible?

fun find(list: List<Int>): Int? { list.forEach { if (it > 10) return it } return null }