diff --git a/.travis.yml b/.travis.yml index bba5919..4d3e195 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ julia: - nightly notifications: email: false +matrix: + allow_failures: + - julia: nightly # uncomment the following lines to override the default test script #script: # - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi diff --git a/src/IndirectArrays.jl b/src/IndirectArrays.jl index ec14cda..7961497 100644 --- a/src/IndirectArrays.jl +++ b/src/IndirectArrays.jl @@ -40,6 +40,18 @@ Base.IndexStyle(::Type{IndirectArray{T,N,A,V}}) where {T,N,A,V} = IndexStyle(A) Base.copy(A::IndirectArray) = IndirectArray(copy(A.index), copy(A.values)) +if VERSION < v"0.6.3" + # This method is only necessary because of a bug in Julia 0.6.2 and can be removed + # when we no longer support that version + @inline function Base.getindex(A::IndirectArray{<:Any,1}, i::Int) + @boundscheck checkbounds(A.index, i) + @inbounds idx = A.index[i] + @boundscheck checkbounds(A.values, idx) + @inbounds ret = A.values[idx] + ret + end +end + @inline function Base.getindex(A::IndirectArray, i::Int) @boundscheck checkbounds(A.index, i) @inbounds idx = A.index[i]