Make common ArrayList declaration not open and implementing RandomAccess
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
package kotlin.collections
|
||||
|
||||
expect open class ArrayList<E> : MutableList<E> {
|
||||
expect class ArrayList<E> : MutableList<E>, RandomAccess {
|
||||
constructor()
|
||||
constructor(initialCapacity: Int)
|
||||
constructor(elements: Collection<E>)
|
||||
|
||||
@@ -901,7 +901,7 @@ class CollectionTest {
|
||||
}
|
||||
|
||||
@Test fun randomAccess() {
|
||||
assertTrue(arrayListOf(1) is RandomAccess, "ArrayList is RandomAccess")
|
||||
assertStaticAndRuntimeTypeIs<RandomAccess>(arrayListOf(1))
|
||||
assertTrue(listOf(1, 2) is RandomAccess, "Default read-only list implementation is RandomAccess")
|
||||
assertTrue(listOf(1) is RandomAccess, "Default singleton list is RandomAccess")
|
||||
assertTrue(emptyList<Int>() is RandomAccess, "Empty list is RandomAccess")
|
||||
|
||||
Reference in New Issue
Block a user