Skip to content

Bug in PersistentList - list is broken after removeAll call #92

@maio

Description

@maio

It only happens in certain situations. It can be reproduced using following test:

class PersistentListTest {
    @Test
    fun `persistent list fails`() {
        var xs = persistentListOf(
            *(1..1885).map { it }.toTypedArray()
        )

        xs = xs.removeAll(
            (1..1837).map { it }
        )

        println(xs.size)

        xs.forEach {
            print(it)
        }
    }
}

print(it.i) fails with exception

java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class java.lang.Number
 ([Ljava.lang.Object; and java.lang.Number are in module java.base of loader 'bootstrap')

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions