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

Commit

Permalink
Fix broadcast() error on Julia 0.6
Browse files Browse the repository at this point in the history
These functions were simply renamed in JuliaLang/julia#16986.
  • Loading branch information
nalimilan committed Oct 25, 2016
1 parent 863d716 commit 4febe6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/broadcast.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
using Base: promote_eltype
using Base.Broadcast: check_broadcast_shape, broadcast_shape
using Base.Cartesian
if VERSION >= v"0.6.0-dev.693"
using Base.Broadcast: check_broadcast_indices, broadcast_indices
else
using Base.Broadcast: check_broadcast_shape, broadcast_shape
const check_broadcast_indices = check_broadcast_shape
const broadcast_indices = broadcast_shape
end

if VERSION >= v"0.5.0-dev+5189"
_to_shape(dims::Base.DimsOrInds) = map(_to_shape, dims)
Expand Down Expand Up @@ -171,7 +177,7 @@ else
lift=false)
nargs = length(Xs)
shape = indices(Z)
check_broadcast_shape(shape, Xs...)
check_broadcast_indices(shape, Xs...)
keeps, Idefaults = map_newindexer(shape, Xs)
Base.Broadcast._broadcast!(f, Z, keeps, Idefaults, Xs, Val{nargs}; lift=lift)
return Z
Expand All @@ -192,7 +198,7 @@ implementation of `broadcast` in `base/broadcast.jl`.
""" ->
@inline function Base.broadcast(f, Xs::NullableArray...;lift::Bool=false)
return broadcast!(f, NullableArray(eltype(promote_eltype(Xs...)),
_to_shape(broadcast_shape(Xs...))),
_to_shape(broadcast_indices(Xs...))),
Xs...; lift=lift)
end

Expand Down

0 comments on commit 4febe6b

Please sign in to comment.