@@ -11,20 +11,9 @@ export bitbroadcast, dotview
11
11
export broadcast_getindex, broadcast_setindex!
12
12
13
13
# # Broadcasting utilities ##
14
-
15
- broadcast_array_type () = Array
16
- broadcast_array_type (A, As... ) =
17
- if is_nullable_array (A) || broadcast_array_type (As... ) === Array{Nullable}
18
- Array{Nullable}
19
- else
20
- Array
21
- end
22
-
23
14
# fallbacks for some special cases
24
15
@inline broadcast (f, x:: Number... ) = f (x... )
25
16
@inline broadcast {N} (f, t:: NTuple{N} , ts:: Vararg{NTuple{N}} ) = map (f, t, ts... )
26
- @inline broadcast (f, As:: AbstractArray... ) =
27
- broadcast_c (f, broadcast_array_type (As... ), As... )
28
17
29
18
# special cases for "X .= ..." (broadcast!) assignments
30
19
broadcast! (:: typeof (identity), X:: AbstractArray , x:: Number ) = fill! (X, x)
@@ -313,7 +302,7 @@ ziptype{T}(::Type{T}, A) = typestuple(T, A)
313
302
ziptype {T} (:: Type{T} , A, B) = (Base. @_pure_meta ; Iterators. Zip2{typestuple (T, A), typestuple (T, B)})
314
303
@inline ziptype {T} (:: Type{T} , A, B, C, D... ) = Iterators. Zip{typestuple (T, A), ziptype (T, B, C, D... )}
315
304
316
- _broadcast_type {S} (:: Type{S} , f, T:: Type , As... ) = Base. _return_type (S , typestuple (S, T, As... ))
305
+ _broadcast_type {S} (:: Type{S} , f, T:: Type , As... ) = Base. _return_type (f , typestuple (S, T, As... ))
317
306
_broadcast_type {T} (:: Type{T} , f, A, Bs... ) = Base. _default_eltype (Base. Generator{ziptype (T, A, Bs... ), ftype (f, A, Bs... )})
318
307
319
308
# broadcast methods that dispatch on the type of the final container
0 commit comments