Skip to content

Decide what to do about Base.memhash value #59151

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions