diff --git a/Project.toml b/Project.toml index 1e7b0fd..fa188de 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "OffsetArrays" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.12.9" +version = "1.12.10" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" @@ -12,7 +12,7 @@ CatIndices = "0.2" DistributedArrays = "0.6" Documenter = "0.27" EllipsisNotation = "1" -FillArrays = "0.11, 0.13" +FillArrays = "0.11, 0.13, 1" StaticArrays = "1" julia = "0.7, 1" diff --git a/src/OffsetArrays.jl b/src/OffsetArrays.jl index 4c4ad41..2a03bf5 100644 --- a/src/OffsetArrays.jl +++ b/src/OffsetArrays.jl @@ -349,7 +349,7 @@ _similar_axes_or_length(AT, ax::I, ::I) where {I} = similar(AT, map(_indexlength # reshape accepts a single colon Base.reshape(A::AbstractArray, inds::OffsetAxis...) = reshape(A, inds) -function Base.reshape(A::AbstractArray, inds::Tuple{OffsetAxis,Vararg{OffsetAxis}}) +function Base.reshape(A::AbstractArray, inds::Tuple{Vararg{OffsetAxis}}) AR = reshape(no_offset_view(A), map(_indexlength, inds)) O = OffsetArray(AR, map(_offset, axes(AR), inds)) return _popreshape(O, axes(AR), _filterreshapeinds(inds)) diff --git a/test/Project.toml b/test/Project.toml index 096d6bf..da67f5b 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -18,5 +18,5 @@ CatIndices = "0.2" DistributedArrays = "0.6" Documenter = "0.27" EllipsisNotation = "1" -FillArrays = "0.11, 0.13" +FillArrays = "0.11, 0.13, 1" StaticArrays = "1" diff --git a/test/runtests.jl b/test/runtests.jl index e3afd1a..2aacaad 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1893,6 +1893,10 @@ end A = OffsetArray(rand(4, 4), -1, -1) @test reshape(A, (:, )) == vec(A) @test reshape(A, :) == vec(A) + + # ensure that there's no ambiguity using AbstractArray and Tuple{Vararg{OffsetAxis}} + @test reshape(Fill(0), ()) === Fill(0) + @test reshape(Fill(2,6), big(2), :) == Fill(2, 2, 3) end @testset "permutedims" begin