ITADN

Fix Base.hash to use only the two-arg method

#403Pull Requestadienes 创建于 2026-03-19
A
adienescommented
Generated as part of an ecosystem-wide audit for one-arg hash methods. `Base.hash` should only be extended via the two-arg method `hash(x, h::UInt)`. Defining a one-arg `hash(x)` method, or giving the second argument a default value, can lead to correctness bugs (hash contract violations when the seed differs from the hard-coded default) and invalidation-related performance issues. This is particularly necessary for Julia 1.13+ where the default hash seed value will change. This PR was generated with the assistance of generative AI.
合并状态:未合并 3 条评论