Slackbot
08/02/2026, 12:38 PMYoussef Shoaib [MOD]
08/02/2026, 12:58 PMfun interface Foo { fun foo() }
// Is translated into
interface Foo { fun foo() }
fun Foo(impl: () -> Unit) = object: Foo { override fun foo(): Unit = impl() }
Like any other callable overload, the import will bring both in. That's because import bar.baz.Foo always brings in the type named Foo if it exists, and any functions in that package named Foo.
Again, idk the compiler magic here, so it might be the case that this callable overload is actually always inlined or something, or that maybe Foo is magically both a type and a callable (as if it had a constructor).Youssef Shoaib [MOD]
08/04/2026, 11:12 AMfun interface, they suggest to keep the callable overload as deprecated hidden for binary compatibilityYoussef Shoaib [MOD]
08/04/2026, 11:34 AM