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