```// in kotlin you can suspend fun hi() { sus...
# language-evolution
m
Copy code
// in kotlin you can
suspend fun hi() {
    suspend fun thing() {
    }
 
    thing()
}

// you can
suspend fun hi() {
    val thing: suspend () -> Unit = {
    }

    thing()
}

// you can
fun hi() {
    val thing = fun() {
    }
  
    thing()
}

// but you CAN'T
suspend fun hi() {
    val thing = suspend fun() {
    }

    thing()
}
any specific reason?
🤔 2
e
Copy code
val thing = suspend {
}
works fine, the grammar just doesn't allow for suspending anonymous functions right now. in fact, suspending function literals aren't a "real" thing either;
suspend {}
isn't a keyword, but rather an inline function taking a lambda: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/suspend.html