diff --git a/base/arraymath.jl b/base/arraymath.jl index a22a58ace86b96..844c6f1b7dc466 100644 --- a/base/arraymath.jl +++ b/base/arraymath.jl @@ -51,7 +51,7 @@ end for f in (:+, :-, :div, :mod, :&, :|, :$) @eval ($f){S,T}(A::AbstractArray{S}, B::AbstractArray{T}) = - _elementwise($f, A, B, promote_eltype_op($f, A, B)) + _elementwise($f, A, B, promote_op($f, S, T)) end function _elementwise{S,T}(op, A::AbstractArray{S}, B::AbstractArray{T}, ::Type{Any}) promote_shape(A,B) # check size compatibility diff --git a/base/broadcast.jl b/base/broadcast.jl index 6c20306a47c391..a8c588132808df 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -3,7 +3,7 @@ module Broadcast using Base.Cartesian -using Base: promote_op, promote_eltype, promote_eltype_op, @get!, _msk_end, unsafe_bitgetindex, linearindices, to_shape, tail, dimlength, OneTo +using Base: promote_op, promote_eltype_op, @get!, _msk_end, unsafe_bitgetindex, linearindices, to_shape, tail, dimlength, OneTo import Base: .+, .-, .*, ./, .\, .//, .==, .<, .!=, .<=, .÷, .%, .<<, .>>, .^ export broadcast, broadcast!, bitbroadcast export broadcast_getindex, broadcast_setindex! @@ -277,8 +277,8 @@ eltype_plus(As::AbstractArray...) = promote_eltype_op(+, As...) for op in (:+, :*, :÷, :%, :<<, :>>, :-, :/, :\, ://, :^) @eval begin function $(Symbol(:., op))(A::AbstractArray, B::AbstractArray) - T = Base.promote_op($(op), eltype(A), eltype(B)) - return broadcast_t($(op), T, A, B) + T = promote_op($op, eltype(A), eltype(B)) + return broadcast_t($op, T, A, B) end end end