From c7b3d14b5a322e4e97f445727fc3b45375171b14 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Sun, 10 Jun 2018 22:42:15 +0200 Subject: [PATCH] Fix two more deprecations --- src/array.jl | 2 +- test/12_missingarray.jl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/array.jl b/src/array.jl index 2f5eadb4..39828ff5 100644 --- a/src/array.jl +++ b/src/array.jl @@ -410,7 +410,7 @@ function copyto!(dest::CatArrOrSub{T, N}, dstart::Integer, n::Integer) where {T, N} n == 0 && return dest n < 0 && throw(ArgumentError(string("tried to copy n=", n, " elements, but n should be nonnegative"))) - destinds, srcinds = linearindices(dest), linearindices(src) + destinds, srcinds = LinearIndices(dest), LinearIndices(src) (dstart ∈ destinds && dstart+n-1 ∈ destinds) || throw(BoundsError(dest, dstart:dstart+n-1)) (sstart ∈ srcinds && sstart+n-1 ∈ srcinds) || throw(BoundsError(src, sstart:sstart+n-1)) diff --git a/test/12_missingarray.jl b/test/12_missingarray.jl index fa27c447..3602a603 100644 --- a/test/12_missingarray.jl +++ b/test/12_missingarray.jl @@ -1034,7 +1034,7 @@ end end @testset "vcat with all empty array" begin - ca1 = CategoricalArray(0) + ca1 = CategoricalArray(undef, 0) ca2 = CategoricalArray([missing, "b"]) r = vcat(ca1, ca2) @test r ≅ [missing, "b"] @@ -1043,7 +1043,7 @@ end end @testset "vcat with all missings and empty" begin - ca1 = CategoricalArray(0) + ca1 = CategoricalArray(undef, 0) ca2 = CategoricalArray([missing, missing]) r = vcat(ca1, ca2) @test r ≅ [missing, missing] @@ -1056,7 +1056,7 @@ end @test isordered(r) ca1 = CategoricalArray(["a", missing]) - ca2 = CategoricalArray{Union{String, Missing}}(2) + ca2 = CategoricalArray{Union{String, Missing}}(undef, 2) ordered!(ca1, true) @test isempty(levels(ca2)) r = vcat(ca1, ca2)