Skip to content

Make (again) length type match index type in sparse vectors #45937

Closed
JuliaSparse/SparseArrays.jl
#176
@dpinol

Description

@dpinol

In julia 1.6, typeof(length(SparseArray))always returned an Int64.
But in julia 1.7, after #39645 it returned the same type as the index type.
Now in julia 1.8rc1, the type is again always an Int64.
The regression was introduced by #41510, since length(array) is calculated through prod.

On the other hand, I understand that the promotion may be necessary for n-dimensional arrays, since the length may overflow the type of the individual dimensions. So, if we want to stick to Int64, maybe we could document it in the julia 1.8 release notes?

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    sparseSparse arrays

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions