interface I { fun foo(): String } fun bar(): I = object: I { override fun foo(): String { return "a" } }