@@ -331,7 +331,7 @@ const _promote_type_binary_detected_infinite_recursion_exception = let
331
331
s = " `promote_type`: detected unbounded recursion caused by faulty `promote_rule` logic"
332
332
ArgumentError (s)
333
333
end
334
- function _promote_type_binary (:: Type{T} , :: Type{S} , recursion_depth_limit:: Tuple{Vararg{Nothing}} ) where {T,S}
334
+ function _promote_type_binary (T :: Type , S :: Type , recursion_depth_limit:: Tuple{Vararg{Nothing}} )
335
335
function err_giving_up ()
336
336
@noinline
337
337
throw (_promote_type_binary_recursion_depth_limit_exception)
@@ -341,7 +341,7 @@ function _promote_type_binary(::Type{T}, ::Type{S}, recursion_depth_limit::Tuple
341
341
throw (_promote_type_binary_detected_infinite_recursion_exception)
342
342
end
343
343
type_is_bottom (X:: Type ) = X <: Bottom
344
- detect_loop (:: Type{A} , :: Type{B} ) where {A , B} = _types_are_equal (T, A) && _types_are_equal (S, B)
344
+ detect_loop (T :: Type , S :: Type , A :: Type , B:: Type ) = _types_are_equal (T, A) && _types_are_equal (S, B)
345
345
if type_is_bottom (T)
346
346
return S
347
347
end
@@ -356,7 +356,7 @@ function _promote_type_binary(::Type{T}, ::Type{S}, recursion_depth_limit::Tuple
356
356
if type_is_bottom (st) && type_is_bottom (ts)
357
357
return typejoin (T, S)
358
358
end
359
- if detect_loop (ts, st) || detect_loop (st, ts)
359
+ if detect_loop (T, S, ts, st) || detect_loop (T, S, st, ts)
360
360
# This is not strictly necessary, as we already limit the recursion depth, but
361
361
# makes for nicer UX.
362
362
err_detected_infinite_recursion ()
0 commit comments