Skip to content

Commit

Permalink
Merge pull request #351 from JuliaLang/teh/collect_version
Browse files Browse the repository at this point in the history
Support `collect` for rc-releases of Julia 0.5
  • Loading branch information
timholy authored Apr 19, 2017
2 parents 665eefe + 1308c10 commit d5bc9f9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Currently, the `@compat` macro supports the following syntaxes:

* `@compat Base.IndexStyle(::Type{<:MyArray}) = IndexLinear()` and `@compat Base.IndexStyle(::Type{<:MyArray}) = IndexCartesian()` to define traits for abstract arrays, replacing the former `Base.linearindexing{T<:MyArray}(::Type{T}) = Base.LinearFast()` and `Base.linearindexing{T<:MyArray}(::Type{T}) = Base.LinearSlow()`, respectively.

* `Compat.collect(A)` returns an Array even on 0.5, no matter what indices the array `A` has. [#21257]
* `Compat.collect(A)` returns an `Array`, no matter what indices the array `A` has (Julia 0.5 and higher). [#21257]

## Module Aliases

Expand Down
2 changes: 1 addition & 1 deletion src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ else
end

# https://github.com/JuliaLang/julia/pull/21257
if v"0.5.0" <= VERSION < v"0.6.0-pre.beta.28"
if v"0.5.0-rc1+46" <= VERSION < v"0.6.0-pre.beta.28"
collect(A) = collect_indices(indices(A), A)
collect_indices(::Tuple{}, A) = copy!(Array{eltype(A)}(), A)
collect_indices(indsA::Tuple{Vararg{Base.OneTo}}, A) =
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ let x = fill!(StringVector(5), 0x61)
end

# collect
if VERSION >= v"0.5.0"
if VERSION >= v"0.5.0-rc1+46"
using OffsetArrays
a = OffsetArray(1:3, -1:1)
b = Compat.collect(a)
Expand Down

0 comments on commit d5bc9f9

Please sign in to comment.