単一の abstract メソッドを持つ Java インターフェースを実装している匿名のオブジェクトリテラルで、ラムダ式での呼び出しに変換できるものを報告します。

例:


class SomeService {
  val threadPool = Executors.newCachedThreadPool()
    
  fun foo() {
    threadPool.submit(object : Runnable {
      override fun run() {
        println("hello")
      }
    })
  }
}

クイックフィックス適用後:


  fun foo() {
    threadPool.submit { println("hello") }
  }