Skip to content

Commit c57067f

Browse files
committed
type_is_bottom -> _type_is_bottom
1 parent 7215a03 commit c57067f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

base/promotion.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ function _types_are_equal(A::Type, B::Type)
265265
ccall(:jl_types_equal, Cint, (Any, Any), A, B) !== Cint(0)
266266
end
267267

268+
function _type_is_bottom(X::Type)
269+
X <: Bottom
270+
end
271+
268272
## promotion mechanism ##
269273

270274
"""
@@ -340,21 +344,20 @@ function _promote_type_binary(T::Type, S::Type, recursion_depth_limit::Tuple{Var
340344
@noinline
341345
throw(_promote_type_binary_detected_infinite_recursion_exception)
342346
end
343-
type_is_bottom(X::Type) = X <: Bottom
344347
detect_loop_onesided(T::Type, S::Type, A::Type, B::Type) = _types_are_equal(T, A) && _types_are_equal(S, B)
345348
detect_loop(T::Type, S::Type, A::Type, B::Type) = detect_loop_onesided(T, S, A, B) || detect_loop_onesided(T, S, B, A)
346-
if type_is_bottom(T)
349+
if _type_is_bottom(T)
347350
return S
348351
end
349-
if type_is_bottom(S) || _types_are_equal(S, T)
352+
if _type_is_bottom(S) || _types_are_equal(S, T)
350353
return T
351354
end
352355
# Try promote_rule in both orders.
353356
ts = promote_rule(T, S)
354357
st = promote_rule(S, T)
355358
# If no promote_rule is defined, both directions give Bottom. In that
356359
# case use typejoin on the original types instead.
357-
if type_is_bottom(st) && type_is_bottom(ts)
360+
if _type_is_bottom(st) && _type_is_bottom(ts)
358361
return typejoin(T, S)
359362
end
360363
if detect_loop(T, S, ts, st)

0 commit comments

Comments
 (0)