interface Sized { val size: Int } class A : J(), Collection { override fun isEmpty(): Boolean { throw UnsupportedOperationException() } override fun contains(element: T): Boolean { throw UnsupportedOperationException() } override fun iterator(): Iterator { throw UnsupportedOperationException() } override fun containsAll(elements: Collection): Boolean { throw UnsupportedOperationException() } } fun box(): String { val a = A() if (a.size != 123) return "fail 1" val c: Collection = a if (c.size != 123) return "fail 2" val sized: Sized = a if (sized.size != 123) return "fail 3" return "OK" }