Skip to content

Commit 598d0a5

Browse files
committed
Adjust to upcoming Base Vararg change
There's two changes here: 1. Drop unnecessary `<:` in Vararg. Tuples are already covariant and this form will be deprecated. 2. Use Base.unwrapva, rather than open coding the equivalent, since the implementation will change.
1 parent b6f58ad commit 598d0a5

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/traits.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ number of dimensions, and their dimensions match as determined by [`dimmatch`](@
153153
"""
154154
@pure sizematch(::Size{S1}, ::Size{S2}) where {S1, S2} = sizematch(S1, S2)
155155
@inline sizematch(::Tuple{}, ::Tuple{}) = true
156-
@inline sizematch(S1::Tuple{Vararg{<:StaticDimension, N}}, S2::Tuple{Vararg{<:StaticDimension, N}}) where {N} =
156+
@inline sizematch(S1::Tuple{Vararg{StaticDimension, N}}, S2::Tuple{Vararg{StaticDimension, N}}) where {N} =
157157
dimmatch(S1[1], S2[1]) && sizematch(Base.tail(S1), Base.tail(S2))
158-
@inline sizematch(::Tuple{Vararg{<:StaticDimension}}, ::Tuple{Vararg{<:StaticDimension}}) = false # mismatch in number of dimensions
158+
@inline sizematch(::Tuple{Vararg{StaticDimension}}, ::Tuple{Vararg{StaticDimension}}) = false # mismatch in number of dimensions
159159

160160
"""
161161
sizematch(::Size, A::AbstractArray)

src/util.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ end
1616
@generated function promote_tuple_eltype(::Union{T,Type{T}}) where T <: Tuple
1717
t = Union{}
1818
for i = 1:length(T.parameters)
19-
tmp = T.parameters[i]
20-
if tmp <: Vararg
21-
tmp = tmp.parameters[1]
22-
end
19+
tmp = Base.unwrapva(T.parameters[i])
2320
t = :(promote_type($t, $tmp))
2421
end
2522
return quote

0 commit comments

Comments
 (0)