The following code doesn’t invoke never the “body” function
class Test{
fun main(){
val executor : java.util.concurrent.Executor = TODO()
executor.execute{this::body}
}
fun body() = TODO()
}
the fixed version is
class Test{
fun main(){
val executor : java.util.concurrent.Executor = TODO()
executor.execute(this::body) // <-- fix here
}
fun body() = TODO()
}
A IDE warning (or error) might be helpful.