Skip to content

[BUG] zerodim BlockSparseArray errors on setindex #27

@ogauthe

Description

@ogauthe
b = Block()
bsa = BlockSparseArray{Float64}(())
bsa[b] = bsa[b]
ERROR: MethodError: Cannot `convert` an object of type Array{Float64, 0} to an object of type Float64
The function `convert` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:126
  convert(::Type{T}, ::AbstractChar) where T<:Number
   @ Base char.jl:185
  convert(::Type{<:Number}, ::LabelledNumbers.LabelledInteger)
   @ LabelledNumbers ~/.julia/packages/LabelledNumbers/xPJrg/src/labelledinteger.jl:20
  ...

Stacktrace:
  [1] setindex!(A::Array{Float64, 0}, x::Array{Float64, 0}, i::Int64)
    @ Base ./array.jl:987
  [2] _setindex!
    @ ./abstractarray.jl:1436 [inlined]
  [3] setindex!
    @ ./abstractarray.jl:1413 [inlined]
  [4] call(::BlockSparseArrays.BlockSparseArrayInterface, ::typeof(setindex!), a::BlockSparseArray{…}, value::Array{…}, I::BlockIndex{…})
    @ BlockSparseArrays ~/.julia/packages/BlockSparseArrays/AQVwd/src/blocksparsearrayinterface/blocksparsearrayinterface.jl:160
  [5] (::DerivableInterfaces.InterfaceFunction{…})(::BlockSparseArray{…}, ::Vararg{…}; kwargs::@Kwargs{})
    @ DerivableInterfaces ~/.julia/packages/DerivableInterfaces/NtnZJ/src/interface_function.jl:17
  [6] setindex!(a::BlockSparseArray{…}, value::Array{…}, I::BlockIndex{…})
    @ BlockSparseArrays ~/.julia/packages/BlockSparseArrays/AQVwd/src/abstractblocksparsearray/wrappedabstractblocksparsearray.jl:140
  [7] call(::BlockSparseArrays.BlockSparseArrayInterface, ::typeof(setindex!), a::BlockSparseArray{…}, value::Array{…})
    @ BlockSparseArrays ~/.julia/packages/BlockSparseArrays/AQVwd/src/blocksparsearrayinterface/blocksparsearrayinterface.jl:140
  [8] (::DerivableInterfaces.InterfaceFunction{…})(::BlockSparseArray{…}, ::Vararg{…}; kwargs::@Kwargs{})
    @ DerivableInterfaces ~/.julia/packages/DerivableInterfaces/NtnZJ/src/interface_function.jl:17
  [9] setindex!(a::BlockSparseArray{…}, value::Array{…})
    @ BlockSparseArrays ~/.julia/packages/BlockSparseArrays/AQVwd/src/abstractblocksparsearray/abstractblocksparsearray.jl:56
 [10] setindex!(block_arr::BlockSparseArray{…}, v::Array{…}, block::Block{…})
    @ BlockArrays ~/.julia/packages/BlockArrays/tOOU0/src/abstractblockarray.jl:161
 [11] top-level scope
    @ REPL[69]:1
Some type information was truncated. Use `show(err)` to see complete types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions