From 986863237274f57586c870c92d6eb2a3b20e16e9 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Tue, 20 Aug 2024 14:33:12 +0530 Subject: [PATCH] Don't specialize Base._reshape (#374) * Don't specialize Base._reshape * Restore downstream tests --------- Co-authored-by: Sheehan Olver --- .github/workflows/downstream.yml | 7 ++++--- src/FillArrays.jl | 9 ++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 30fde31f..b65bcf64 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -40,12 +40,13 @@ jobs: package: - {repo: Distributions.jl, group: JuliaStats} - {repo: BlockArrays.jl, group: JuliaArrays} - # - {repo: LazyArrays.jl, group: JuliaArrays} + - {repo: LazyArrays.jl, group: JuliaArrays} + - {repo: InfiniteArrays.jl, group: JuliaArrays} - {repo: ArrayLayouts.jl, group: JuliaLinearAlgebra} - # - {repo: LazyBandedMatrices.jl, group: JuliaLinearAlgebra} + - {repo: LazyBandedMatrices.jl, group: JuliaLinearAlgebra} - {repo: BandedMatrices.jl, group: JuliaLinearAlgebra} - {repo: BlockBandedMatrices.jl, group: JuliaLinearAlgebra} - # - {repo: InfiniteLinearAlgebra.jl, group: JuliaLinearAlgebra} + - {repo: InfiniteLinearAlgebra.jl, group: JuliaLinearAlgebra} - {repo: Optim.jl, group: JuliaNLSolvers} steps: diff --git a/src/FillArrays.jl b/src/FillArrays.jl index c38b9618..170e07d3 100644 --- a/src/FillArrays.jl +++ b/src/FillArrays.jl @@ -272,17 +272,12 @@ reshape(parent::AbstractFill, dims::Tuple{Vararg{Union{Int,Colon}}}) = fill_reshape(parent, Base._reshape_uncolon(parent, dims)...) reshape(parent::AbstractFill, shp::Tuple{Union{Integer,Base.OneTo}, Vararg{Union{Integer,Base.OneTo}}}) = reshape(parent, Base.to_shape(shp)) -reshape(parent::AbstractFill, dims::Dims) = Base._reshape(parent, dims) -reshape(parent::AbstractFill, dims::Tuple{Integer, Vararg{Integer}}) = Base._reshape(parent, dims) +reshape(parent::AbstractFill, dims::Dims) = fill_reshape(parent, dims...) +reshape(parent::AbstractFill, dims::Tuple{Integer, Vararg{Integer}}) = fill_reshape(parent, dims...) # resolve ambiguity with Base reshape(parent::AbstractFillVector, dims::Tuple{Colon}) = parent -Base._reshape(parent::AbstractFill, dims::Dims) = fill_reshape(parent, dims...) -Base._reshape(parent::AbstractFill, dims::Tuple{Integer,Vararg{Integer}}) = fill_reshape(parent, dims...) -# Resolves ambiguity error with `_reshape(v::AbstractArray{T, 1}, dims::Tuple{Int})` -Base._reshape(parent::AbstractFill{T, 1, Axes}, dims::Tuple{Int}) where {T, Axes} = fill_reshape(parent, dims...) - for (AbsTyp, Typ, funcs, func) in ((:AbstractZeros, :Zeros, :zeros, :zero), (:AbstractOnes, :Ones, :ones, :one)) @eval begin abstract type $AbsTyp{T, N, Axes} <: AbstractFill{T, N, Axes} end