Is there any way to avoid specifying type of inter...
# announcements
a
Is there any way to avoid specifying type of interfaces that Java treats as functional (and does type inference)?
Copy code
kotlin
fun a(runnable: Runnable) {
  runnable.run()
}

fun b() {
  a({ doSomething() }) // Won’t compile.
  a(() -> doSomething()) // Won’t compile.
  a(() -> { doSomething() }) // Won’t compile.

  a(Runnable{ doSomething() }) // Will compile.
}