interface SomeInterface object Container { private inline fun someMethod() = object : SomeInterface { } class SomeClass : SomeInterface by someMethod() } fun box(): String { Container.SomeClass() return "OK" }