234234end
235235
236236# broadcast methods that dispatch on the type found by inference
237- function _broadcast_t (f, :: Type{Any} , shape, iter, As... )
237+ function broadcast_t (f, :: Type{Any} , shape, iter, As... )
238238 nargs = length (As)
239239 keeps, Idefaults = map_newindexer (shape, As)
240240 st = start (iter)
@@ -244,7 +244,7 @@ function _broadcast_t(f, ::Type{Any}, shape, iter, As...)
244244 B[I] = val
245245 return _broadcast! (f, B, keeps, Idefaults, As, Val{nargs}, iter, st, 1 )
246246end
247- @inline function _broadcast_t (f, T, shape, iter, As... )
247+ @inline function broadcast_t (f, T, shape, iter, As... )
248248 B = similar (Array{T}, shape)
249249 nargs = length (As)
250250 keeps, Idefaults = map_newindexer (shape, As)
254254
255255# broadcast method that uses inference to find the type, but preserves abstract
256256# container types when possible (used by binary elementwise operators)
257- @inline broadcast_t (f, As... ) = broadcast! (f, similar (Array{promote_eltype_op (f, As... )}, broadcast_indices (As... )), As... )
257+ @inline broadcast_elwise_op (f, As... ) =
258+ broadcast! (f, similar (Array{promote_eltype_op (f, As... )}, broadcast_indices (As... )), As... )
258259
259260ftype (f, A) = typeof (a -> f (a))
260261ftype (f, A... ) = typeof (a -> f (a... ))
@@ -465,10 +466,10 @@ end
465466# # elementwise operators ##
466467
467468for op in (:÷ , :% , :<< , :>> , :- , :/ , :\ , :// , :^ )
468- @eval $ (Symbol (:., op))(A:: AbstractArray , B:: AbstractArray ) = broadcast_t ($ op, A, B)
469+ @eval $ (Symbol (:., op))(A:: AbstractArray , B:: AbstractArray ) = broadcast_elwise_op ($ op, A, B)
469470end
470- .+ (As:: AbstractArray... ) = broadcast_t (+ , As... )
471- .* (As:: AbstractArray... ) = broadcast_t (* , As... )
471+ .+ (As:: AbstractArray... ) = broadcast_elwise_op (+ , As... )
472+ .* (As:: AbstractArray... ) = broadcast_elwise_op (* , As... )
472473
473474# ## element-wise comparison operators returning BitArray ##
474475
0 commit comments