From cfce90c997685a858cfdc2ed7ac9a72c737f5374 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Mon, 27 Aug 2018 13:58:15 +0200 Subject: [PATCH] Remove `Compat.collect(A)` Was added in #350 and #351, now obsolete as no longer required on minimum supported Julia version 0.6. --- README.md | 3 --- src/Compat.jl | 14 -------------- test/runtests.jl | 12 ------------ 3 files changed, 29 deletions(-) diff --git a/README.md b/README.md index b924ca1d7..cbea8303a 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,6 @@ Please check the list below for the specific syntax you need. Currently, the `@compat` macro supports the following syntaxes: -* `Compat.collect(A)` returns an `Array`, no matter what indices the array `A` has. [#21257] - * `@compat foo(::CartesianRange{N})` to replace the former `foo(::CartesianRange{CartesianIndex{N}})` ([#20974]). Note that `CartesianRange` now has two type parameters, so using them as @@ -524,7 +522,6 @@ includes this fix. Find the minimum version from there. [#20407]: https://github.com/JuliaLang/julia/issues/20407 [#20974]: https://github.com/JuliaLang/julia/issues/20974 [#21197]: https://github.com/JuliaLang/julia/issues/21197 -[#21257]: https://github.com/JuliaLang/julia/issues/21257 [#21346]: https://github.com/JuliaLang/julia/issues/21346 [#21709]: https://github.com/JuliaLang/julia/issues/21709 [#22064]: https://github.com/JuliaLang/julia/issues/22064 diff --git a/src/Compat.jl b/src/Compat.jl index 99e34ee3c..0eda7c595 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -326,20 +326,6 @@ else end end -# https://github.com/JuliaLang/julia/pull/21257 -@static if 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) = - copy!(Array{eltype(A)}(map(length, indsA)), A) - function collect_indices(indsA, A) - B = Array{eltype(A)}(map(length, indsA)) - copy!(B, CartesianRange(indices(B)), A, CartesianRange(indsA)) - end -else - const collect = Base.collect -end - # https://github.com/JuliaLang/julia/pull/21197 if VERSION < v"0.7.0-DEV.257" # allow the elements of the Cmd to be accessed as an array or iterator diff --git a/test/runtests.jl b/test/runtests.jl index 66e526211..b82eb6123 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -508,18 +508,6 @@ using Compat: StringVector @test length(StringVector(5)) == 5 @test String(fill!(StringVector(5), 0x61)) == "aaaaa" -# collect -if VERSION < v"0.7.0-" - # Note: This is disabled on 0.7, since the Compat.collect functionality is only - # applicable on 0.5, and OffsetArrays currently has some incompatibilities with - # 0.7. This can be reenabled later if needed. - using OffsetArrays - a = OffsetArray(1:3, -1:1) - b = Compat.collect(a) - @test indices(b) === (Base.OneTo(3),) - @test b == [1,2,3] -end - # PR 22064 module Test22064 using Compat