diff --git a/src/broadcast.jl b/src/broadcast.jl index 4b8d376..82bbbf6 100644 --- a/src/broadcast.jl +++ b/src/broadcast.jl @@ -102,7 +102,7 @@ function broadcast_mutability(x, op, args::Vararg{Any,N}) where {N} return broadcast_mutability(typeof(x), op, typeof.(args)...) end -_checked_size(s, x::AbstractArray) = length(x) == s +_checked_size(s, x::AbstractArray) = size(x) == s _checked_size(::Any, ::Any) = true _checked_size(::Any, ::Tuple{}) = true function _checked_size(s, x::Tuple) @@ -123,7 +123,8 @@ function broadcast_mutability( op, args::Vararg{Any,N}, ) where {N} - if !_checked_size(length(x), args)::Bool + @show x, args + if !_checked_size(size(x), args)::Bool return IsNotMutable() end return broadcast_mutability(typeof(x), op, typeof.(args)...)