Skip to content

docs for copyto! causes ambiguity errors #46933

@longemen3000

Description

@longemen3000

the broadcasting docs mention this optional method to define implace broadcast assignment:

Customizing broadcasting

Methods to implement Brief description
... ...
Bypassing default machinery
Base.copyto!(dest, bc::Broadcasted{DestStyle}) Custom implementation of broadcast!, specializing on DestStyle
... ...

But defining copyto!(x<:Any,bc::Broadcasted{DestSyle}) causes ambiguity errors for any subsequent package that needs to do the same. i found this recently in StaticArrays + DataFrames JuliaArrays/StaticArrays.jl#1097 , where StaticArrays defines Base.copyto!(dest, B::Broadcasted{<:StaticArrayStyle}), causing ambiguity errors down the line, while following the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collectiondocsThis change adds or pertains to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions