Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base.hash for EnumX-generated enum types broken with Julia 1.10 (nightly) #5

Closed
tkemmer opened this issue May 24, 2023 · 2 comments
Closed

Comments

@tkemmer
Copy link

tkemmer commented May 24, 2023

Base.hash behavior for enum types was changed very recently (JuliaLang/julia@22551a2, present in current Julia nightly), affecting enum types generated with EnumX.jl. In particular, computing hash values for EnumX-generated enum types now results in a stack overflow:

Previous behavior:

julia> @enumx Fruits Apple Banana

julia> hash(Fruits.Apple)
0xfab008b31fa7e45a

New behavior:

julia> @enumx Fruits Apple Banana

julia> hash(Fruits.Apple)
ERROR: StackOverflowError:
Stacktrace:
     [1] hash(x::Main.Fruits.T, h::UInt64)
       @ Base.Enums ./Enums.jl:31
     [2] _enum_hash(x::Main.Fruits.T, h::UInt64)
       @ Base.Enums ./Enums.jl:30
--- the last 2 lines are repeated 39990 more times ---
 [79983] hash(x::Main.Fruits.T, h::UInt64)
       @ Base.Enums ./Enums.jl:31
@fredrikekre
Copy link
Owner

JuliaLang/julia#49964

@tkemmer
Copy link
Author

tkemmer commented May 27, 2023

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants