Skip to content

ambiguity generated by default copyto! method #1097

Closed
@longemen3000

Description

@longemen3000

this line:

@inline Base.copyto!(dest, B::Broadcasted{<:StaticArrayStyle}) = _copyto!(dest, B)

seems that _copyto! only special handles methods that have static axes. is is correct to assume that those axes only happen on x <: AbstractArray ?. if that is the case, then other type trying to dispatch on copyto! only needs to define:

copyto!(dest::MyType,bc::Base.Broadcsast.AbstractArrayType{N})

then, if an external package needs to define
but the catchall method causes ambiguities in that regard.

I did a test run of StaticArrays on julia 1.8/windows, and removed that method. all tests passed.

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