reactormonk
09/07/2022, 8:25 AMsetContent {
...
suspend fun func1() {
func2()
}
suspend fun func2() {
func1()
}
}
Tells me func2
isn't defined in func1
dmitriy.novozhilov
09/07/2022, 8:33 AM...
val x = y // y is not defined
val y = x
...
Youssef Shoaib [MOD]
09/07/2022, 12:32 PMsetContent {
...
suspend fun func1(func2: suspend () -> Unit) {
func2()
}
suspend fun func2() {
func1(::func2)
}
suspend fun func1() = func1(::func2)
}
That should do the trick! It's kinda inspired by Y-combinators from Lambda Calculusreactormonk
09/07/2022, 2:23 PM