Skip to content

broadcasting of Tuples and SVectors is broken #485

Closed
@dlfivefifty

Description

@dlfivefifty
julia> (1,2) .+ [1,2]
2-element Array{Int64,1}:
 2
 4

julia> (1,2) .+ SVector(1,2) # I expected SVector(2,4)
ERROR: MethodError: no method matching +(::Tuple{Int64,Int64}, ::Int64)
Closest candidates are:
  +(::Any, ::Any, ::Any, ::Any...) at operators.jl:502
  +(::Complex{Bool}, ::Real) at complex.jl:292
  +(::Missing, ::Number) at missing.jl:93
  ...
Stacktrace:
 [1] macro expansion at /Users/sheehanolver/.julia/packages/StaticArrays/Ze5H3/src/broadcast.jl:133 [inlined]
 [2] _broadcast at /Users/sheehanolver/.julia/packages/StaticArrays/Ze5H3/src/broadcast.jl:94 [inlined]
 [3] copy at /Users/sheehanolver/.julia/packages/StaticArrays/Ze5H3/src/broadcast.jl:24 [inlined]
 [4] materialize(::Base.Broadcast.Broadcasted{StaticArrays.StaticArrayStyle{1},Nothing,typeof(+),Tuple{Tuple{Int64,Int64},SArray{Tuple{2},Int64,1,2}}}) at ./broadcast.jl:724
 [5] top-level scope at none:0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions