https://github.com/JuliaLang/julia
Revision 22551a2fba93c6289be1764d7bd640739a7dd582 authored by Stephan Hilb on 23 May 2023, 11:15:31 UTC, committed by GitHub on 23 May 2023, 11:15:31 UTC
Previously `@enum` defined `Base.hash(::MyEnumType, ::UInt)` on the
user-defined enum type `MyEnumType`.
When the user wants to specialize the hash function for his own enum
type he will define exactly that method signature again which overwrites
it and leads to the warning

    WARNING: Method definition hash(TestPackage.MyEnumType, UInt64) in module TestPackage at Enums.jl:210 overwritten at [...]
      ** incremental compilation may be fatally broken for this module **

This commit changes `@enum` so that an internal method is used instead
which is called through a fallback `Base.hash(::Enum, ::UInt)`.
1 parent f44be79
History
Tip revision: 22551a2fba93c6289be1764d7bd640739a7dd582 authored by Stephan Hilb on 23 May 2023, 11:15:31 UTC
allow specializing `Base.hash` for enum types without overwriting method (#49777)
Tip revision: 22551a2
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 514 bytes
.mailmap -rw-r--r-- 12.1 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 23.1 KB
HISTORY.md -rw-r--r-- 363.4 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 54.5 KB
Makefile -rw-r--r-- 29.8 KB
NEWS.md -rw-r--r-- 5.3 KB
README.md -rw-r--r-- 7.3 KB
THIRDPARTY.md -rw-r--r-- 3.8 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 35.8 KB
pkgimage.mk -rw-r--r-- 5.8 KB
sysimage.mk -rw-r--r-- 4.2 KB

README.md

back to top