Skip to content

Commit

Permalink
define broadcast! earlier (fixes JuliaLang#18462)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj committed Dec 13, 2016
1 parent 612bfdd commit 9984deb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Broadcast
using Base.Cartesian
using Base: promote_eltype_op, _default_eltype, linearindices, tail, OneTo, to_shape,
_msk_end, unsafe_bitgetindex, bitcache_chunks, bitcache_size, dumpbitcache
import Base: broadcast
export broadcast!, bitbroadcast, dotview
import Base: broadcast, broadcast!
export bitbroadcast, dotview
export broadcast_getindex, broadcast_setindex!

## Broadcasting utilities ##
Expand All @@ -18,7 +18,6 @@ export broadcast_getindex, broadcast_setindex!

# special cases for "X .= ..." (broadcast!) assignments
broadcast!(::typeof(identity), X::AbstractArray, x::Number) = fill!(X, x)
broadcast!(f, X::AbstractArray) = fill!(X, f())
broadcast!(f, X::AbstractArray, x::Number...) = fill!(X, f(x...))
function broadcast!{T,S,N}(::typeof(identity), x::AbstractArray{T,N}, y::AbstractArray{S,N})
check_broadcast_shape(broadcast_indices(x), broadcast_indices(y))
Expand Down
1 change: 1 addition & 0 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Symbol(x...) = Symbol(string(x...))
# specific array types etc.
# --Here, just define fallback routines for broadcasting with no arguments
broadcast(f) = f()
broadcast!(f, X::AbstractArray) = fill!(X, f())

# array structures
include("array.jl")
Expand Down

0 comments on commit 9984deb

Please sign in to comment.