Skip to content

Decide what to do about Base.memhash value #59151

@vtjnash

Description

@vtjnash

In reviewing some code patterns, I noticed that most uses in the ecosystem of Base.memhash are unsound (are reimplementing the same function in Base in order to drop the mandatory GC roots), but a few previously used to be okay. Now all of them are unsound since the implementation changed in #57509 in a major breaking way for most of the users. We should consider whether we want to fix this constant (which used to be defined to be the definition of AbstractString hashing) or delete it entirely (so that all users are sound, by virtue of throwing an exception, and can switch to the new hashing API) or define Base.hash on AbstractString so that users can delete their unsound implementations and fallback to a correct one (given that Base already defines == on AbstractString, not defining hash was already incorrect)

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwinghashingminor changeMarginal behavior change acceptable for a minor releasestrings"Strings!"

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions