Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit 4febe6b

Browse files
committed
Fix broadcast() error on Julia 0.6
These functions were simply renamed in JuliaLang/julia#16986.
1 parent 863d716 commit 4febe6b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/broadcast.jl

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
using Base: promote_eltype
2-
using Base.Broadcast: check_broadcast_shape, broadcast_shape
32
using Base.Cartesian
3+
if VERSION >= v"0.6.0-dev.693"
4+
using Base.Broadcast: check_broadcast_indices, broadcast_indices
5+
else
6+
using Base.Broadcast: check_broadcast_shape, broadcast_shape
7+
const check_broadcast_indices = check_broadcast_shape
8+
const broadcast_indices = broadcast_shape
9+
end
410

511
if VERSION >= v"0.5.0-dev+5189"
612
_to_shape(dims::Base.DimsOrInds) = map(_to_shape, dims)
@@ -171,7 +177,7 @@ else
171177
lift=false)
172178
nargs = length(Xs)
173179
shape = indices(Z)
174-
check_broadcast_shape(shape, Xs...)
180+
check_broadcast_indices(shape, Xs...)
175181
keeps, Idefaults = map_newindexer(shape, Xs)
176182
Base.Broadcast._broadcast!(f, Z, keeps, Idefaults, Xs, Val{nargs}; lift=lift)
177183
return Z
@@ -192,7 +198,7 @@ implementation of `broadcast` in `base/broadcast.jl`.
192198
""" ->
193199
@inline function Base.broadcast(f, Xs::NullableArray...;lift::Bool=false)
194200
return broadcast!(f, NullableArray(eltype(promote_eltype(Xs...)),
195-
_to_shape(broadcast_shape(Xs...))),
201+
_to_shape(broadcast_indices(Xs...))),
196202
Xs...; lift=lift)
197203
end
198204

0 commit comments

Comments
 (0)