I have a third party Java library which an object with interface like this:
public interface Handler { void call(C context) throws Exception; } >
I had a case where I did not want to create a var for it but do it inline. The way I achieved it is
funA(object: InterfaceListener { override fun OnMethod1() {} override fun OnMethod2() {} })