Missing inspection for callable reference in a lambda


#1

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.


#2

This inspection was implemented by Yoshinori Isogai and will be delivered in 1.1.3: https://youtrack.jetbrains.com/issue/KT-17053