You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using Compat
julia> c =CartesianIndices((1:2,))
2-element Compat.CartesianIndices{1,Tuple{UnitRange{Int64}}}:CartesianIndex{1}((1,))
CartesianIndex{1}((2,))
julia>length(c)
ERROR: MethodError: no method matching prod(::Tuple{Int64})
You may have intended to import Base.prod
Closest candidates are:prod(::Any, ::AbstractArray; dims) at /home/rdeits/.julia/v0.6/Compat/src/Compat.jl:1723prod(::AbstractArray; dims) at /home/rdeits/.julia/v0.6/Compat/src/Compat.jl:1717
Stacktrace:
[1] length(::Compat.CartesianIndices{1,Tuple{UnitRange{Int64}}}) at /home/rdeits/.julia/v0.6/Compat/src/Compat.jl:1288
Yes, it's intentional. The call to prod needs to be prefixed with Base. Missed in #518, sorry. (Seems like we're missing a test for that length method.)
Using Compat.jl master:
The problem is here:
Compat.jl/src/Compat.jl
Line 1715 in 294f171
where a new
prod()
function is declared, rather than extendingBase.prod
, and then that overwritten version is called here:Compat.jl/src/Compat.jl
Line 1288 in 294f171
Is it intentional that Compat is overwriting rather than extending those functions?
The text was updated successfully, but these errors were encountered: