-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
FillArrays are not mutable.
julia> ArrayInterface.ismutable(typeof(Fill(4, (2,2))))
true
Should be
function ismutable(::Type{T}) where {T<:AbstractArray}
if parent_type(T) <: T
return false # no parent, and have not hit a type we know about
else
return ismutable(parent_type(T))
end
end
ismutable{::Type{<:Array}} = true
ismutable{::Type{<:SparseVector}} = true
ismutable{::Type{<:SparseMatrixCSC}} = true
ismutable{::Type{<:BitArray}} = true
Alternatively
the fallback case could be: return T.mutable
rather than false
.
On the assumption that if you are a mutable struct that has subtypes AbstractArray
you probably have defined setindex
Metadata
Metadata
Assignees
Labels
No labels