Skip to content

Commit

Permalink
remove uses of deprecated items. fixes #13052
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Sep 10, 2015
1 parent 17e36e6 commit b5a251b
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
7 changes: 3 additions & 4 deletions base/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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},))
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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->d<N ? UnitRange{Int} : Float64, N)
# Indexing with (UnitRange, UnitRange, Int)
args = ntuple(d->d<N ? UnitRange{Int} : Int, N)
N > 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}]
Expand Down
2 changes: 1 addition & 1 deletion test/compile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 10 additions & 10 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -823,20 +823,20 @@ 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
@test baar(Vector) == 2
@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)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/linalg/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b5a251b

Please sign in to comment.