diff --git a/runtime/src/main/kotlin/kotlin/collections/Collections.kt b/runtime/src/main/kotlin/kotlin/collections/Collections.kt index 137098677d4..2ec2349366f 100644 --- a/runtime/src/main/kotlin/kotlin/collections/Collections.kt +++ b/runtime/src/main/kotlin/kotlin/collections/Collections.kt @@ -27,7 +27,7 @@ internal object EmptyIterator : ListIterator { override fun previous(): Nothing = throw NoSuchElementException() } -internal object EmptyList : List/*, RandomAccess */ { +internal object EmptyList : List, RandomAccess { override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty() override fun hashCode(): Int = 1 @@ -187,7 +187,7 @@ public interface MutableIterable : Iterable { } public fun Array.asList(): List { - return object : AbstractList() { + return object : AbstractList(), RandomAccess { override val size: Int get() = this@asList.size override fun isEmpty(): Boolean = this@asList.isEmpty() override fun contains(element: T): Boolean = this@asList.contains(element)