Skip to content

Inconsistent names between List and Map methods #26544

Open
@jabraham17

Description

In #21395, we decided to remove the various get* methods on map (getReference(), getBorrowed() and getValue()). These were added to avoid accidentally transferring ownership of classes, but in #21395 the decision was made to have a single get()/this() method that just was carefully implemented to work with owned classes.

However, in making this decision, list seems to have been overlooked. list has a getValue() and getBorrowed() (as well as a this()), instead of a single get()/this() like map. While there doesn't seem to be anything inherently wrong with the implementation, the asymmetry of the names is unfortunate and potentially confusing for users.

I propose making similar updates to list, where getValue() and getBorrowed() are replaced with a single get. However, this is a breaking change and will need to be handled accordingly.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions