Skip to content

Error when broadcast-assigning scalar to ArrayPartition #67

@jlumpe

Description

@jlumpe

I don't know enough about broadcasting or the AbstractArray interface to know what's actually going on here. This is with version 1.0.0.

julia> a = ArrayPartition(zeros(10))
([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],)

julia> a .= 1.
ERROR: MethodError: copyto!(::ArrayPartition{Float64,Tuple{Array{Float64,1}}}, ::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Tuple{Base.OneTo{Int64}},typeof(identity),Tuple{Float64}}) is ambiguous. Candidates:
  copyto!(dest::ArrayPartition, bc::Base.Broadcast.Broadcasted) in RecursiveArrayTools at /Users/student/.julia/packages/RecursiveArrayTools/vxlTS/src/array_partition.jl:247
  copyto!(dest::AbstractArray, bc::Base.Broadcast.Broadcasted{#s623,Axes,F,Args} where Args<:Tuple where F where Axes where #s623<:Base.Broadcast.AbstractArrayStyle{0}) in Base.Broadcast at broadcast.jl:803
Possible fix, define
  copyto!(::ArrayPartition, ::Base.Broadcast.Broadcasted{#s623,Axes,F,Args} where Args<:Tuple where F where Axes where #s623<:Base.Broadcast.AbstractArrayStyle{0})
Stacktrace:
 [1] materialize!(::ArrayPartition{Float64,Tuple{Array{Float64,1}}}, ::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,typeof(identity),Tuple{Float64}}) at ./broadcast.jl:756
 [2] top-level scope at none:0

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