Skip to content

SizedArray changes to SArray #755

@jwscook

Description

@jwscook

Possibly related to #734, #537.

Hi All,

I've encountered a problem where adding two SizedArrays creates an SArray, when I'd have thought the outcome would be a SizedArray:

julia> a = SizedVector{1}([1])
1-element SizedArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 1

julia> b = SizedVector{1}([1])
1-element SizedArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 1

julia> a + b
1-element SArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 2

julia> a .+ b
1-element SArray{Tuple{1},Int64,1,1} with indices SOneTo(1):
 3

Is this intended?

Cheers,
James

Version info:

Version 1.3.2-pre.0 (2019-12-31)
release-1.3/2e6715c045 (fork: 118 commits, 217 days)
(v1.3) pkg> st StaticArrays
    Status `~/.julia/environments/v1.3/Project.toml`
  [90137ffa] StaticArrays v0.12.0 [`~/.julia/dev/StaticArrays`]
  [37e2e46d] LinearAlgebra 

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