Skip to content

Commit

Permalink
Avoid ambiguity warning in cachedvector getindex (#64)
Browse files Browse the repository at this point in the history
* Avoid ambiguity warning in cachedvector getindex

* add tests
  • Loading branch information
dlfivefifty authored Feb 22, 2021
1 parent 9b5e679 commit bc62b56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteArrays"
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
version = "0.10.1"
version = "0.10.2"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
2 changes: 1 addition & 1 deletion src/InfiniteArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Statistics: mean, median

import FillArrays: AbstractFill, getindex_value, fill_reshape, RectDiagonal, Fill, Ones, Zeros, Eye
import LazyArrays: LazyArrayStyle, AbstractBandedLayout, MemoryLayout, LazyLayout, UnknownLayout,
ZerosLayout, AbstractArrayApplyStyle, CachedArray, CachedVector, ApplyLayout, LazyMatrix,
ZerosLayout, AbstractArrayApplyStyle, AbstractCachedVector, CachedArray, CachedVector, ApplyLayout, LazyMatrix,
reshapedlayout, sub_materialize, LayoutMatrix, LayoutVector, _padded_sub_materialize, PaddedLayout

import DSP: conv
Expand Down
2 changes: 2 additions & 0 deletions src/infarrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,6 @@ _unsafe_getindex(::IndexLinear, A::Vcat, r::InfUnitRange) = _vcat(_gettail(first

getindex(A::AbstractVector, r::InfRanges{<:Integer}) = layout_getindex(A, r)
getindex(A::LayoutVector, r::InfRanges{<:Integer}) = layout_getindex(A, r)
getindex(A::AbstractCachedVector, r::InfRanges{<:Integer}) = layout_getindex(A, r)
getindex(A::CachedVector{<:Any,<:AbstractVector,<:AbstractFill{<:Any,1}}, r::InfRanges{<:Integer}) = layout_getindex(A, r)
getindex(A::AbstractFill{<:Any,1}, r::InfRanges{<:Integer}) = FillArrays.fillsimilar(A, length(r))
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ end
@test [[1,2]; [3,4]; [5,6]; Zeros(∞)] isa Vcat{<:Any,1,<:Tuple{Array,Zeros}}

@test [randn(2,2); Zeros(∞,2)] isa Vcat{<:Any,2,<:Tuple{Array,Zeros}}

a = [[1,2,3]; zeros(Int,∞)]
@test a[3:∞][1:5] == a[3:7]
@test cache(1:∞)[2:∞][1:5] == 2:6
end

@testset "sparse print" begin
Expand Down

2 comments on commit bc62b56

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/30607

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.2 -m "<description of version>" bc62b560d3b9c931c073564c2165f058476a7902
git push origin v0.10.2

Please sign in to comment.