Inconsistent names between List and Map methods #26544
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.