Align ListBuilder with native ArrayList

Furthermore, add test for ListBuilder.subList detection of concurrent
modification, and fix error in ListBuilder and ArrayList.

Fix KT-62346
This commit is contained in:
Troels Bjerre Lund
2023-10-05 15:25:01 +02:00
committed by Space Cloud
parent d62dbbb1bd
commit 5a8faa8775
4 changed files with 508 additions and 307 deletions
@@ -252,6 +252,12 @@ class ConcurrentModificationTest {
action(subList)
}
}
assertFailsWith<ConcurrentModificationException> {
buildList<String> {
addAll(listOf("a", "b", "c"))
for (e in subList(1, 3)) remove(e)
}
}
}
@Test