-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix bug with max_values in union! #30315
Conversation
c796054
to
6a904e8
Compare
max_values(::Type{Bool}) = 2 | ||
max_values(::Type{Nothing}) = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be applied to all singleton types? You can check whether a type is a singleton using isdefined(T, :instance)
(there's an issingletontype
helper function for this in replace.jl).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes seems like a good idea!
As CI is green and I think this is an urgent fix to have, I will merge as-is later today and implement your idea (which is not directly related to the bugfix) separately.
(cherry picked from commit f49cb42)
(cherry picked from commit f49cb42)
(cherry picked from commit f49cb42)
(cherry picked from commit f49cb42)
(cherry picked from commit f49cb42)
(cherry picked from commit f49cb42)
This fixes a bug in
union!
leading to currently havingSet([nothing, true, false])
having only two elements :(