240240end
241241
242242# broadcast methods that dispatch on the type found by inference
243- function _broadcast_t (f, :: Type{Any} , shape, iter, As... )
243+ function broadcast_t (f, :: Type{Any} , shape, iter, As... )
244244 nargs = length (As)
245245 keeps, Idefaults = map_newindexer (shape, As)
246246 st = start (iter)
@@ -250,7 +250,7 @@ function _broadcast_t(f, ::Type{Any}, shape, iter, As...)
250250 B[I] = val
251251 return _broadcast! (f, B, keeps, Idefaults, As, Val{nargs}, iter, st, 1 )
252252end
253- @inline function _broadcast_t (f, T, shape, iter, As... )
253+ @inline function broadcast_t (f, T, shape, iter, As... )
254254 B = similar (Array{T}, shape)
255255 nargs = length (As)
256256 keeps, Idefaults = map_newindexer (shape, As)
260260
261261# broadcast method that uses inference to find the type, but preserves abstract
262262# container types when possible (used by binary elementwise operators)
263- @inline broadcast_t (f, As... ) = broadcast! (f, similar (Array{promote_eltype_op (f, As... )}, broadcast_indices (As... )), As... )
263+ @inline broadcast_elwise_op (f, As... ) =
264+ broadcast! (f, similar (Array{promote_eltype_op (f, As... )}, broadcast_indices (As... )), As... )
264265
265266ftype (f, A) = typeof (a-> f (a))
266267ftype (f, A... ) = typeof (a-> f (a... ))
@@ -272,7 +273,7 @@ ziptype(A, B) = Zip2{Tuple{eltype(A)},Tuple{eltype(B)}}
272273
273274# broadcast methods that dispatch on the type of the final container
274275@inline function broadcast_c (f, :: Type{Array} , As... )
275- S = _default_eltype (Generator{ziptype (As... ),ftype (f, As... )})
276+ T = _default_eltype (Generator{ziptype (As... ),ftype (f, As... )})
276277 shape = broadcast_indices (As... )
277278 iter = CartesianRange (shape)
278279 if isleaftype (T)
@@ -471,10 +472,10 @@ end
471472# # elementwise operators ##
472473
473474for op in (:÷ , :% , :<< , :>> , :- , :/ , :\ , :// , :^ )
474- @eval $ (Symbol (:., op))(A:: AbstractArray , B:: AbstractArray ) = broadcast_t ($ op, A, B)
475+ @eval $ (Symbol (:., op))(A:: AbstractArray , B:: AbstractArray ) = broadcast_elwise_op ($ op, A, B)
475476end
476- .+ (As:: AbstractArray... ) = broadcast_t (+ , As... )
477- .* (As:: AbstractArray... ) = broadcast_t (* , As... )
477+ .+ (As:: AbstractArray... ) = broadcast_elwise_op (+ , As... )
478+ .* (As:: AbstractArray... ) = broadcast_elwise_op (* , As... )
478479
479480# ## element-wise comparison operators returning BitArray ##
480481
0 commit comments