From b5a251bf1498dca907ecceb748eeb2015bca8c9a Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 10 Sep 2015 11:00:16 -0400 Subject: [PATCH] remove uses of deprecated items. fixes #13052 --- base/precompile.jl | 7 +++---- test/arrayops.jl | 6 +++--- test/compile.jl | 2 +- test/core.jl | 20 ++++++++++---------- test/dict.jl | 6 +++--- test/linalg/dense.jl | 2 +- test/linalg/tridiag.jl | 2 +- test/ranges.jl | 4 ++-- 8 files changed, 24 insertions(+), 25 deletions(-) diff --git a/base/precompile.jl b/base/precompile.jl index b65fdaf960a53..bf3aed56cf6a7 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -180,7 +180,6 @@ precompile(Base.async_run_thunk, (Function,)) precompile(Base.atexit, (Function,)) precompile(Base.banner, (Base.Terminals.TTYTerminal,)) precompile(Base.startswith, (ASCIIString, ASCIIString)) -precompile(Base.bool, (Bool,)) precompile(Base.bytestring, (ASCIIString,)) precompile(Base.call, (Type{Base.Dict{Symbol, Any}}, Base.Pair{Symbol, Base.LineEdit.Prompt}, Base.Pair{Symbol, Base.LineEdit.Prompt}, Base.Pair{Symbol, Base.LineEdit.Prompt})) precompile(Base.call, (Array{Any, 1}, Type{Base.LineEdit.Prompt}, ASCIIString)) @@ -255,8 +254,8 @@ precompile(Base.include_from_node1, (UTF8String,)) precompile(Base.init_stdio, (Ptr{Void},)) precompile(Base.input_color, ()) precompile(Base.insert!, (Array{Any,1}, Int, Base.GlobalRef)) -precompile(Base.int, (Int,)) -precompile(Base.int, (UInt,)) +precompile(Base.Int, (Int,)) +precompile(Base.Int, (UInt,)) precompile(Base.isabspath, (ASCIIString,)) precompile(Base.isempty, (ASCIIString,)) precompile(Base.isempty, (Array{Any,1},)) @@ -413,7 +412,7 @@ precompile(Base.takebuf_string, (IOBuffer,)) precompile(Base.task_local_storage, ()) precompile(Base.terminate_all_workers, ()) precompile(Base.try_include, (ASCIIString,)) -precompile(Base.uint, (UInt,)) +precompile(Base.UInt, (UInt,)) precompile(Base.unsafe_copy!, (Array{Dict{Any, Any}, 1}, Int, Array{Dict{Any, Any}, 1}, Int, Int)) precompile(Base.unsafe_copy!, (Ptr{Dict{Any, Any}}, Ptr{Dict{Any, Any}}, Int)) precompile(Base.unshift!, (Array{Any,1}, Task)) diff --git a/test/arrayops.jl b/test/arrayops.jl index 5012d4a7cfc15..41ce0612d1d3c 100644 --- a/test/arrayops.jl +++ b/test/arrayops.jl @@ -136,7 +136,7 @@ b = [4, 6, 2, -7, 1] ind = findin(a, b) @test ind == [3,4] -rt = Base.return_types(setindex!, Tuple{Array{Int32, 3}, UInt8, Vector{Int}, Float64, UnitRange{Int}}) +rt = Base.return_types(setindex!, Tuple{Array{Int32, 3}, UInt8, Vector{Int}, Int16, UnitRange{Int}}) @test length(rt) == 1 && rt[1] == Array{Int32, 3} # construction @@ -915,8 +915,8 @@ for N = 1:Nmax @test Base.return_types(getindex, Tuple{Array{Float32, N}, args...}) == [Array{Float32, N}] @test Base.return_types(getindex, Tuple{BitArray{N}, args...}) == Any[BitArray{N}] @test Base.return_types(setindex!, Tuple{Array{Float32, N}, Array{Int, 1}, args...}) == [Array{Float32, N}] - # Indexing with (UnitRange, UnitRange, Float64) - args = ntuple(d->dd 1 && @test Base.return_types(getindex, Tuple{Array{Float32, N}, args...}) == [Array{Float32, N-1}] N > 1 && @test Base.return_types(getindex, Tuple{BitArray{N}, args...}) == [BitArray{N-1}] N > 1 && @test Base.return_types(setindex!, Tuple{Array{Float32, N}, Array{Int, 1}, args...}) == [Array{Float32, N}] diff --git a/test/compile.jl b/test/compile.jl index 43f2b7fc09f65..49b6c5cfdc57b 100644 --- a/test/compile.jl +++ b/test/compile.jl @@ -80,7 +80,7 @@ try """) end println(STDERR, "\nNOTE: The following 'LoadError: break me' indicates normal operation") - @test_throws ErrorException require(:FooBar) + @test_throws ErrorException Base.require(:FooBar) finally splice!(Base.LOAD_CACHE_PATH, 1) splice!(LOAD_PATH, 1) diff --git a/test/core.jl b/test/core.jl index 89f123be78fea..705240eafc113 100644 --- a/test/core.jl +++ b/test/core.jl @@ -102,11 +102,11 @@ testintersect(Type{Any},Type{Complex}, Bottom) testintersect(Type{Any},Type{TypeVar(:T,Real)}, Bottom) @test !(Type{Array{Integer}} <: Type{AbstractArray{Integer}}) @test !(Type{Array{Integer}} <: Type{Array{TypeVar(:T,Integer)}}) -testintersect(Type{Function},UnionType,Bottom) +testintersect(Type{Function},Union,Bottom) testintersect(Type{Int32}, DataType, Type{Int32}) @test !(Type <: TypeVar) testintersect(DataType, Type, Bottom, isnot) -testintersect(UnionType, Type, Bottom, isnot) +testintersect(Union, Type, Bottom, isnot) testintersect(DataType, Type{Int}, Bottom, isnot) testintersect(DataType, Type{TypeVar(:T,Int)}, Bottom, isnot) testintersect(DataType, Type{TypeVar(:T,Integer)}, Bottom, isnot) @@ -143,11 +143,11 @@ end @test !issubtype(Array{Tuple{Int,Int}}, Array{NTuple}) @test !issubtype(Type{Tuple{Void}}, Tuple{Type{Void}}) -# this is fancy: know that any type T<:Number must be either a DataType or a UnionType -@test Type{TypeVar(:T,Number)} <: Union{DataType,UnionType} +# this is fancy: know that any type T<:Number must be either a DataType or a Union +@test Type{TypeVar(:T,Number)} <: Union{DataType,Union} @test !(Type{TypeVar(:T,Number)} <: DataType) -@test !(Type{TypeVar(:T,Tuple)} <: Union{Tuple,UnionType}) -@test Type{TypeVar(:T,Tuple)} <: Union{DataType,UnionType} +@test !(Type{TypeVar(:T,Tuple)} <: Union{Tuple,Union}) +@test Type{TypeVar(:T,Tuple)} <: Union{DataType,Union} # issue #2997 let T = TypeVar(:T,Union{Float64,Array{Float64,1}},true) @@ -823,7 +823,7 @@ let local baar, foor, boor # issue #1131 baar(x::DataType) = 0 - baar(x::UnionType) = 1 + baar(x::Union) = 1 baar(x::TypeConstructor) = 2 @test baar(StridedArray) == 2 @test baar(StridedArray.body) == 1 @@ -831,12 +831,12 @@ let @test baar(Vector.body) == 0 boor(x) = 0 - boor(x::UnionType) = 1 + boor(x::Union) = 1 @test boor(StridedArray) == 0 @test boor(StridedArray.body) == 1 # issue #1202 - foor(x::UnionType) = 1 + foor(x::Union) = 1 @test_throws MethodError foor(StridedArray) @test foor(StridedArray.body) == 1 @test_throws MethodError foor(StridedArray) @@ -3254,7 +3254,7 @@ Base.return_types(getindex, (Vector{nothing},)) module MyColors abstract Paint{T} -immutable RGB{T<:FloatingPoint} <: Paint{T} +immutable RGB{T<:AbstractFloat} <: Paint{T} r::T g::T b::T diff --git a/test/dict.jl b/test/dict.jl index c5d0ae48876a2..1de632b7a3c5d 100644 --- a/test/dict.jl +++ b/test/dict.jl @@ -77,9 +77,9 @@ h["a","b","c"] = 4 @test valtype(h) == Any let - td = Dict{String,Float64}() - @test eltype(td) == Pair{String,Float64} - @test keytype(td) == String + td = Dict{AbstractString,Float64}() + @test eltype(td) == Pair{AbstractString,Float64} + @test keytype(td) == AbstractString @test valtype(td) == Float64 end diff --git a/test/linalg/dense.jl b/test/linalg/dense.jl index ab0b18621fe2d..d1f3ce90cdd4c 100644 --- a/test/linalg/dense.jl +++ b/test/linalg/dense.jl @@ -96,7 +96,7 @@ debug && println("Numbers") @test expm(α) == exp(α) debug && println("Powers") - if eltya <: FloatingPoint + if eltya <: AbstractFloat z = zero(eltya) t = convert(eltya,2) r = convert(eltya,2.5) diff --git a/test/linalg/tridiag.jl b/test/linalg/tridiag.jl index ff5443cb24232..e65d2f5801660 100644 --- a/test/linalg/tridiag.jl +++ b/test/linalg/tridiag.jl @@ -84,7 +84,7 @@ for elty in (Float32, Float64, Complex64, Complex128, Int) @test_approx_eq full(full(Tldlt)) Fs @test_throws DimensionMismatch Tldlt\rand(elty,n+1) @test size(Tldlt) == size(Ts) - if elty <: FloatingPoint + if elty <: AbstractFloat @test typeof(convert(Base.LinAlg.LDLt{Float32},Tldlt)) == Base.LinAlg.LDLt{Float32,SymTridiagonal{elty}} end end diff --git a/test/ranges.jl b/test/ranges.jl index edac1d2e50218..a4a53ed49cc02 100644 --- a/test/ranges.jl +++ b/test/ranges.jl @@ -108,8 +108,8 @@ end @test intersect(reverse(typemin(Int):2:typemax(Int)),typemin(Int):2:typemax(Int)) == reverse(typemin(Int):2:typemax(Int)) @test intersect(typemin(Int):2:typemax(Int),reverse(typemin(Int):2:typemax(Int))) == typemin(Int):2:typemax(Int) -@test 0 in UInt(0):100:typemax(Uint) -@test last(UInt(0):100:typemax(Uint)) in UInt(0):100:typemax(Uint) +@test 0 in UInt(0):100:typemax(UInt) +@test last(UInt(0):100:typemax(UInt)) in UInt(0):100:typemax(UInt) @test -9223372036854775790 in -9223372036854775790:100:9223372036854775710 @test -9223372036854775690 in -9223372036854775790:100:9223372036854775710 @test -90 in -9223372036854775790:100:9223372036854775710