Skip to content

Should broadcast on Adjoint should use the parent array's BroadcastStyle? #25671

@andyferris

Description

@andyferris

It seems that BroadcastStyle(::Type{<:Adjoint}) uses the default style instead of that of its parent.

E.g. at an earlier stage today I was upgrading StaticArrays to work on v0.7 and came across this:

julia> using StaticArrays

julia> Broadcast.BroadcastStyle(SVector{3, Float64}))
Base.Broadcast.DefaultArrayStyle{2}()

This gives different results in vector + vector' than I originally expected, even though we've defined a StaticArrayStyle <: AbstractArrayStyle.

Would using the parent's array style work, or might there be some issues with that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions