Introduce RandomAccess to JS.
Make EmptyList support RandomAccess. #KT-10794
This commit is contained in:
@@ -16,7 +16,7 @@ internal object EmptyIterator : ListIterator<Nothing> {
|
||||
override fun previous(): Nothing = throw NoSuchElementException()
|
||||
}
|
||||
|
||||
internal object EmptyList : List<Nothing>, Serializable {
|
||||
internal object EmptyList : List<Nothing>, Serializable, RandomAccess {
|
||||
override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty()
|
||||
override fun hashCode(): Int = 1
|
||||
override fun toString(): String = "[]"
|
||||
|
||||
Reference in New Issue
Block a user