We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50fa83c commit 0105fe4Copy full SHA for 0105fe4
base/abstractset.jl
@@ -83,7 +83,11 @@ end
83
max_values(::Type) = typemax(Int)
84
max_values(T::Union{map(X -> Type{X}, BitIntegerSmall_types)...}) = 1 << (8*sizeof(T))
85
# saturated addition to prevent overflow with typemax(Int)
86
-max_values(T::Union) = max(max_values(T.a), max_values(T.b), max_values(T.a) + max_values(T.b))
+function max_values(T::Union)
87
+ a = max_values(T.a)::Int
88
+ b = max_values(T.b)::Int
89
+ return max(a, b, a + b)
90
+end
91
max_values(::Type{Bool}) = 2
92
max_values(::Type{Nothing}) = 1
93
0 commit comments