Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FillArrays"
uuid = "1a297f60-69ca-5386-bcde-b61e274b549b"
version = "1.14.0"
version = "1.15.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
4 changes: 4 additions & 0 deletions src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,10 @@ function repeat(A::AbstractFill; inner=ntuple(x->1, ndims(A)), outer=ntuple(x->1
_repeat(A, inner=inner, outer=outer)
end

const _checkindex_AbstractUnitRange_AbstractFill = true
Base.checkindex(::Type{Bool}, inds::AbstractUnitRange, I::AbstractFill) = Base.checkindex(Bool, inds, getindex_value(I))
Base.checkindex(::Type{Bool}, inds::AbstractUnitRange, I::AbstractFill{Bool}) = axes(I,1) == inds

include("oneelement.jl")

end # module
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ end
@test StepRangeLen(z) ≡ convert(StepRangeLen, z) ≡ convert(StepRangeLen{Int}, z) ≡ convert(typeof(s), z) ≡ convert(AbstractRange, z) ≡ s
end
end

@testset "checkindex with an AbstractFill index" begin
@test Base.checkindex(Bool, 1:5, Fill(2, 3))
@test !Base.checkindex(Bool, 1:5, Fill(0, 3))
@test Base.checkindex(Bool, 1:5, Fill(true, 5))
@test !Base.checkindex(Bool, 1:5, Fill(true, 2))
end
end

@testset "RectDiagonal" begin
Expand Down
Loading