|
19 | 19 | """
|
20 | 20 | typejoin() = Bottom
|
21 | 21 | typejoin(@nospecialize(t)) = (@_nospecializeinfer_meta; t)
|
22 |
| -typejoin(@nospecialize(t), ts...) = (@_foldable_meta; @_nospecializeinfer_meta; typejoin(t, typejoin(ts...))) |
| 22 | +typejoin(@nospecialize(t), @nospecialize(s), @nospecialize(u)) = (@_foldable_meta; @_nospecializeinfer_meta; typejoin(typejoin(t, s), u)) |
| 23 | +typejoin(@nospecialize(t), @nospecialize(s), @nospecialize(u), ts...) = (@_foldable_meta; @_nospecializeinfer_meta; afoldl(typejoin, typejoin(t, s, u), ts...)) |
23 | 24 | function typejoin(@nospecialize(a), @nospecialize(b))
|
24 | 25 | @_foldable_meta
|
25 | 26 | @_nospecializeinfer_meta
|
@@ -299,7 +300,8 @@ function promote_type end
|
299 | 300 |
|
300 | 301 | promote_type() = Bottom
|
301 | 302 | promote_type(T) = T
|
302 |
| -promote_type(T, S, U, V...) = (@inline; promote_type(T, promote_type(S, U, V...))) |
| 303 | +promote_type(T, S, U) = (@inline; promote_type(promote_type(T, S), U)) |
| 304 | +promote_type(T, S, U, V...) = (@inline; afoldl(promote_type, promote_type(T, S, U), V...)) |
303 | 305 |
|
304 | 306 | promote_type(::Type{Bottom}, ::Type{Bottom}) = Bottom
|
305 | 307 | promote_type(::Type{T}, ::Type{T}) where {T} = T
|
@@ -373,7 +375,9 @@ function _promote(x::T, y::S) where {T,S}
|
373 | 375 | return (convert(R, x), convert(R, y))
|
374 | 376 | end
|
375 | 377 | promote_typeof(x) = typeof(x)
|
376 |
| -promote_typeof(x, xs...) = (@inline; promote_type(typeof(x), promote_typeof(xs...))) |
| 378 | +promote_typeof(x, y) = (@inline; promote_type(typeof(x), typeof(y))) |
| 379 | +promote_typeof(x, y, z) = (@inline; promote_type(typeof(x), typeof(y), typeof(z))) |
| 380 | +promote_typeof(x, y, z, a...) = (@inline; afoldl(((::Type{T}, y) where {T}) -> promote_type(T, typeof(y)), promote_typeof(x, y, z), a...)) |
377 | 381 | function _promote(x, y, z)
|
378 | 382 | @inline
|
379 | 383 | R = promote_typeof(x, y, z)
|
|
0 commit comments