Skip to content

ListBuffer.patchInPlace does not update last0 field, leaving the buffer in a corrupted state #12796

@noresttherein

Description

@noresttherein

Reproduction steps

Scala version: 2.13.10

    import collection.mutable.ListBuffer
    val buffer = ListBuffer(1)
    val patch = Seq(2)
    buffer.patchInPlace(1, patch, 2)
    println(buffer.last)

Problem

Prints 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions