Skip to content

Collision of LazyArrays and FillArrays broadcasting #143

Open
@mcabbott

Description

@mcabbott

This came up here: https://discourse.julialang.org/t/preventing-collect-on-broadcasting-expressions/57996

julia> using LazyArrays, FillArrays

julia> BroadcastArray(+, fill(1,2), 3)
2-element BroadcastVector{Int64, typeof(+), Tuple{Vector{Int64}, Int64}}:
 4
 4

julia> broadcast(+, Fill(1,2), 3)
2-element Fill{Int64, 1, Tuple{Base.OneTo{Int64}}} = 4

julia> BroadcastArray(+, Fill(1,2), 3)
ERROR: type Fill has no field f
Stacktrace:
 [1] getproperty(x::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, f::Symbol)
   @ Base ./Base.jl:33
 [2] call(#unused#::ArrayLayouts.FillLayout, a::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazyapplying.jl:21
 [3] call(a::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazyapplying.jl:22
 [4] BroadcastArray(A::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazybroadcasting.jl:46
 [5] BroadcastArray(f::Function, A::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, As::Int64)
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazybroadcasting.jl:33
 [6] top-level scope
   @ REPL[66]:1

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