Skip to content

getindex return type #1319

@miguelmaso

Description

@miguelmaso

Hi, thank you for your work on this package. I'm new to Julia, so apologies if I'm missing context.

I noticed a possible inconsistency when slicing an SVector:

v = SVector(1,2,3)
typeof(v[1:2]) # Vector{Int64}
typeof(v[:])   # SVector{3, Int64}

I'd have expected both cases to return an SVector, since all of them are already statically sized.

Would it make sense to always return an SVector? Or is there a reason why Vector is returned in the first case?

Thanks again for maintaining this package!

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