open class K fun foo(n: Int) { val x = object : K() { fun bar() = n } }