```val invoke: suspend ()->Unit = fun(){} ``` S...
# getting-started
s
Copy code
val invoke: suspend ()->Unit = fun(){}
Shows this error is it possible to declare suspending anonymous function with fun keyboard. I am also aware of suspending lambda that's not my question. Thanks in advance.😇 error type mismatch: inferred type is () -> unit but suspend () -> unit was expected (line_27.kts132)
y
Copy code
suspend fun(){
    delay(10)
}
simply works