From 2fa3a788d6b338126d7a614e1efb0ebc0d3bd0b6 Mon Sep 17 00:00:00 2001 From: Pablo Zubieta Date: Thu, 29 Dec 2016 15:56:21 -0600 Subject: [PATCH 1/3] Remove `promote_array_type` --- base/arraymath.jl | 9 --------- base/complex.jl | 1 - 2 files changed, 10 deletions(-) diff --git a/base/arraymath.jl b/base/arraymath.jl index 3cd4b1c9acbfd..022866bbfbb38 100644 --- a/base/arraymath.jl +++ b/base/arraymath.jl @@ -57,15 +57,6 @@ end ## Binary arithmetic operators ## -promote_array_type(F, ::Type, ::Type, T::Type) = T -promote_array_type{S<:Real, A<:AbstractFloat}(F, ::Type{S}, ::Type{A}, ::Type) = A -promote_array_type{S<:Integer, A<:Integer}(F, ::Type{S}, ::Type{A}, ::Type) = A -promote_array_type{S<:Integer, A<:Integer}(::typeof(/), ::Type{S}, ::Type{A}, T::Type) = T -promote_array_type{S<:Integer, A<:Integer}(::typeof(\), ::Type{S}, ::Type{A}, T::Type) = T -promote_array_type{S<:Integer}(::typeof(/), ::Type{S}, ::Type{Bool}, T::Type) = T -promote_array_type{S<:Integer}(::typeof(\), ::Type{S}, ::Type{Bool}, T::Type) = T -promote_array_type{S<:Integer}(F, ::Type{S}, ::Type{Bool}, T::Type) = T - for f in (:+, :-, :div, :mod, :&, :|) @eval ($f)(A::AbstractArray, B::AbstractArray) = _elementwise($f, promote_eltype_op($f, A, B), A, B) diff --git a/base/complex.jl b/base/complex.jl index 95ca6ae4cdec2..cea711ca8ad9e 100644 --- a/base/complex.jl +++ b/base/complex.jl @@ -870,7 +870,6 @@ big{T<:AbstractFloat,N}(A::AbstractArray{Complex{T},N}) = convert(AbstractArray{ ## promotion to complex ## _default_type(T::Type{Complex}) = Complex{Int} -promote_array_type{S<:Union{Complex, Real}, T<:AbstractFloat}(F, ::Type{S}, ::Type{Complex{T}}, ::Type) = Complex{T} function complex{S<:Real,T<:Real}(A::AbstractArray{S}, B::AbstractArray{T}) if size(A) != size(B); throw(DimensionMismatch()); end From ff57226dd5f7dbb7317f52fbb0ab7aa84fe57867 Mon Sep 17 00:00:00 2001 From: Pablo Zubieta Date: Thu, 29 Dec 2016 16:41:19 -0600 Subject: [PATCH 2/3] Deprecate `promote_array_type` --- base/deprecated.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/base/deprecated.jl b/base/deprecated.jl index 2c555ed1f5f5d..4fca5aae2b640 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1160,4 +1160,21 @@ function quadgk(args...) end export quadgk +# Not exported, but used outside Base +_promote_array_type(F, ::Type, ::Type, T::Type) = T +_promote_array_type{S<:Real, A<:AbstractFloat}(F, ::Type{S}, ::Type{A}, ::Type) = A +_promote_array_type{S<:Integer, A<:Integer}(F, ::Type{S}, ::Type{A}, ::Type) = A +_promote_array_type{S<:Integer, A<:Integer}(::typeof(/), ::Type{S}, ::Type{A}, T::Type) = T +_promote_array_type{S<:Integer, A<:Integer}(::typeof(\), ::Type{S}, ::Type{A}, T::Type) = T +_promote_array_type{S<:Integer}(::typeof(/), ::Type{S}, ::Type{Bool}, T::Type) = T +_promote_array_type{S<:Integer}(::typeof(\), ::Type{S}, ::Type{Bool}, T::Type) = T +_promote_array_type{S<:Integer}(F, ::Type{S}, ::Type{Bool}, T::Type) = T +_promote_array_type{S<:Union{Complex, Real}, T<:AbstractFloat}(F, ::Type{S}, ::Type{Complex{T}}, ::Type) = Complex{T} +function promote_array_type(F, R, S, T) + Base.depwarn("`promote_array_type` is deprecated as it is no longer needed " * + "in Base. See https://github.com/JuliaLang/julia/issues/19669 " * + "for more information.", :promote_array_type) + _promote_array_type(F, R, S, T) +end + # End deprecations scheduled for 0.6 From 20d9c6fb3db97fb3bddd1104b7d42e1783b23d0f Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sat, 31 Dec 2016 08:31:02 -0800 Subject: [PATCH 3/3] fix mistaken deletion during conflict resolution (squash this out) --- base/deprecated.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/deprecated.jl b/base/deprecated.jl index ac5d05ed62813..9b8113665024d 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1346,6 +1346,9 @@ function quadgk(args...; kwargs...) end export quadgk +# Broadcast now returns a BitArray when the resulting eltype is Bool (#17623) +@deprecate bitbroadcast broadcast + # Deprecate two-argument map! (map!(f, A)) for a cycle in anticipation of semantic change @deprecate map!{F}(f::F, A::AbstractArray) map!(f, A, A) @deprecate asyncmap!(f, c; ntasks=0, batch_size=nothing) asyncmap!(f, c, c; ntasks=ntasks, batch_size=batch_size)