https://kotlinlang.org logo
#announcements
Title
# announcements
v

vgrechka

02/23/2017, 12:24 PM
Hi. Why function
f
below doesn't compile, while
h
does? Is it because of
@kotlin.internal.InlineOnly
annotation on
let
?
Copy code
inline fun g(block: () -> Unit) = block()

    fun f(): Int {
        g {
            return 123
        }
    } // Error: A 'return' expression is required...

    fun h(): Int {
        null.let {
            return 123
        }
    }
🤔 2