Skip to content

PeristentHashMapBuilder.putAll() with another persistent hash map can produce incorrect results. #114

@chuckjaz

Description

@chuckjaz

Consider the following code:

val p = persistentHashMapOf<Int, Int>(99 to 1)
val e = Array(101) { it }.map { it to it }
val c = persistentHashMapOf(*e.toTypedArray())
val n = p.builder().apply { putAll(c) }.build()
println("n[99] = ${n[99]}")

Expected

n[99] = 99

Received

n[99] = 1

Changing the putAll call above to putAll(e) produces the expected result.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions