|
181 | 181 | Base.convert(::Type{Broadcasted{NewStyle}}, bc::Broadcasted{Style,Axes,F,Args}) where {NewStyle,Style,Axes,F,Args} =
|
182 | 182 | Broadcasted{NewStyle,Axes,F,Args}(bc.f, bc.args, bc.axes)
|
183 | 183 |
|
184 |
| -# Fully-instantiatiated Broadcasted |
185 |
| -const BroadcastedF{Style<:Union{Nothing,BroadcastStyle}, N, F, Args<:Tuple} = |
186 |
| - Broadcasted{Style, <:Indices{N}, F, Args} |
| 184 | +Base.show(io::IO, bc::Broadcasted{Style}) where {Style} = print(io, Broadcasted, '{', Style, "}(", bc.f, ", ", bc.args, ')') |
187 | 185 |
|
188 | 186 | ## Allocating the output container
|
189 | 187 | """
|
@@ -233,10 +231,10 @@ argtype(::Type{Broadcasted{Style,Axes,F,Args}}) where {Style,Axes,F,Args} = Args
|
233 | 231 | argtype(bc::Broadcasted) = argtype(typeof(bc))
|
234 | 232 |
|
235 | 233 | const NestedTuple = Tuple{<:Broadcasted,Vararg{Any}}
|
236 |
| -not_nested(bc::Broadcasted) = not_nested(bc.args) |
237 |
| -not_nested(t::Tuple) = not_nested(tail(t)) |
238 |
| -not_nested(::NestedTuple) = false |
239 |
| -not_nested(::Tuple{}) = true |
| 234 | +not_nested(bc::Broadcasted) = _not_nested(bc.args) |
| 235 | +_not_nested(t::Tuple) = _not_nested(tail(t)) |
| 236 | +_not_nested(::NestedTuple) = false |
| 237 | +_not_nested(::Tuple{}) = true |
240 | 238 |
|
241 | 239 | ## Instantiation fills in the "missing" fields in Broadcasted.
|
242 | 240 | instantiate(x) = x
|
@@ -564,11 +562,6 @@ Base.@propagate_inbounds _getindex(args::Tuple{}, I) = ()
|
564 | 562 |
|
565 | 563 | @inline _broadcast_getindex_evalf(f::Tf, args::Vararg{Any,N}) where {Tf,N} = f(args...) # not propagate_inbounds
|
566 | 564 |
|
567 |
| -@noinline function broadcast_getindex_error(bc, I) |
568 |
| - isa(bc, BroadcastedF) && error("axes $(axes(bc)) does not match $I") |
569 |
| - error("indexing requires complete instantiation") |
570 |
| -end |
571 |
| - |
572 | 565 | """
|
573 | 566 | broadcastable(x)
|
574 | 567 |
|
@@ -1187,8 +1180,6 @@ macro __dot__(x)
|
1187 | 1180 | esc(__dot__(x))
|
1188 | 1181 | end
|
1189 | 1182 |
|
1190 |
| -Base.show(io::IO, bc::Broadcasted) = print(io, "Broadcasted(", bc.f, ", ", bc.args, ')') |
1191 |
| - |
1192 | 1183 | @inline make_kwsyntax(f, args...; kwargs...) = make((args...)->f(args...; kwargs...), args...)
|
1193 | 1184 | @inline function make(f, args...)
|
1194 | 1185 | args′ = map(broadcastable, args)
|
|
0 commit comments