From 1c5905a6a9cbd90e44cb1e6bd00abb5eaac95256 Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Mon, 8 Aug 2022 13:30:10 +0200 Subject: [PATCH] Don't use UnionAlls in Varargs --- src/rulesets/Base/array.jl | 4 ++-- src/rulesets/Base/indexing.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rulesets/Base/array.jl b/src/rulesets/Base/array.jl index 7a0269ad4..f76cc9ea9 100644 --- a/src/rulesets/Base/array.jl +++ b/src/rulesets/Base/array.jl @@ -76,8 +76,8 @@ _i_zero(ẋ::AbstractZero, x) = zero(x) # may give a MethodError for `zero` but won't be wrong. # Fast paths. Should it also collapse all-Zero cases? -_instantiate_zeros(ẋs::Tuple{Vararg{<:Number}}, xs) = ẋs -_instantiate_zeros(ẋs::Tuple{Vararg{<:AbstractArray}}, xs) = ẋs +_instantiate_zeros(ẋs::Tuple{Vararg{Number}}, xs) = ẋs +_instantiate_zeros(ẋs::Tuple{Vararg{AbstractArray}}, xs) = ẋs _instantiate_zeros(ẋs::AbstractArray{<:Number}, xs) = ẋs _instantiate_zeros(ẋs::AbstractArray{<:AbstractArray}, xs) = ẋs diff --git a/src/rulesets/Base/indexing.jl b/src/rulesets/Base/indexing.jl index 112c52a31..fbce009e0 100644 --- a/src/rulesets/Base/indexing.jl +++ b/src/rulesets/Base/indexing.jl @@ -12,7 +12,7 @@ function frule((_, ẋ), ::typeof(getindex), x::Tuple, i) end "for a given typle type, returns a Val{N} where N is the length of the tuple" -_tuple_N(::Type{<:Tuple{Vararg{<:Any, N}}}) where {N} = Val(N) +_tuple_N(::Type{<:Tuple{Vararg{Any, N}}}) where {N} = Val(N) function rrule(::typeof(getindex), x::T, i::Integer) where {T<:Tuple} function getindex_back_1(dy)