Skip to content

Moving length here #14

Closed
Closed
@mcabbott

Description

@mcabbott

For JuliaDiff/ForwardDiff.jl#599 to work, length(::Type{StaticArraysCore.SMatrix{3, 3, Float64, 9}}) needs to be defined here in StaticArraysCore.

The present definition is:

https://github.com/JuliaArrays/StaticArrays.jl/blob/f7b8ed21c946fef2e9ecb00d7a27bccdd2623976/src/abstractarray.jl#L1-L2

which needs

https://github.com/JuliaArrays/StaticArrays.jl/blob/28e0482ba006bfb9a4a4f19dbf8b3096b2611497/src/StaticArrays.jl#L71-L86

which depends on LinearAlgebra.

What should happen? This core package has no dependencies right now. Should it gain LinearAlgebra just for this? Otherwise it could just define length for a smaller set of types, and let the main package extend that. I think that would be sufficient for ForwardDiff, whose generated functions e.g. here https://github.com/JuliaDiff/ForwardDiff.jl/blob/c6dc2098b5201943cdb8433ee963078e6dcc7900/src/apiutils.jl#L21-L25 accept only x::StaticArray, never Diagonal(StaticVector) etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions