Skip to content

Commit

Permalink
Added OffsetArrays as hard dependency.
Browse files Browse the repository at this point in the history
This will fix it for now, but I hope this can be resolved properly at a
later date, possibly when conditional depdenencies are added to Pkg.jl

See #3.
  • Loading branch information
Vexatos committed Feb 3, 2020
1 parent 1081a45 commit df3c8bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ authors = ["Vexatos <Stuarzt@gmx.de>"]
url = "https://github.com/Vexatos/CircularArrays.jl"
version = "1.0.0"

[deps]
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"

[compat]
julia = "1.3"
3 changes: 1 addition & 2 deletions src/CircularArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ CircularArray(def::T, size) where T = CircularArray(fill(def, size))
@inline Base.similar(arr::CircularArray, ::Type{T}, dims::Tuple{Int64,Vararg{Int64}}) where T = _similar(arr,T,dims)
# Ambiguity resolution with a type-pirating OffsetArrays method. See OffsetArrays issue #87.
# Ambiguity is triggered in the case similar(arr) where arr.data::OffsetArray.
# The OffsetAxis definition is copied from OffsetArrays.
const OffsetAxis = Union{Integer, UnitRange, Base.OneTo, Base.IdentityUnitRange, Colon}
using OffsetArrays: OffsetAxis
@inline Base.similar(arr::CircularArray, ::Type{T}, dims::Tuple{OffsetAxis, Vararg{OffsetAxis}}) where T = _similar(arr,T,dims)

CircularVector(data::AbstractArray{T, 1}) where T = CircularVector{T}(data)
Expand Down

0 comments on commit df3c8bf

Please sign in to comment.