Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguity error when running copyto! #233

Open
gaurav-arya opened this issue Feb 20, 2023 · 0 comments
Open

Ambiguity error when running copyto! #233

gaurav-arya opened this issue Feb 20, 2023 · 0 comments

Comments

@gaurav-arya
Copy link

gaurav-arya commented Feb 20, 2023

MWE:

julia> a = ApplyArray(vcat, [1], [2])
vcat(1-element Vector{Int64}, 1-element Vector{Int64}):
 1
 2

julia> b = ApplyArray(vcat, [1], [2])
vcat(1-element Vector{Int64}, 1-element Vector{Int64}):
 1
 2

julia> a .= b
ERROR: MethodError: _copyto!(::LazyArrays.ApplyLayout{typeof(vcat)}, ::LazyArrays.ApplyLayout{typeof(vcat)}, ::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}}, ::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}}) is ambiguous.

Candidates:
  _copyto!(::Any, LAY::LazyArrays.ApplyLayout{typeof(vcat)}, dest::AbstractArray{<:Any, N}, V::AbstractArray{<:Any, N}) where N
    @ LazyArrays ~/.julia/packages/LazyArrays/NYra8/src/lazyconcat.jl:237
  _copyto!(::LAY, ::LAY, dest::AbstractArray{<:Any, N}, src::AbstractArray{<:Any, N}) where {LAY<:LazyArrays.ApplyLayout, N}
    @ LazyArrays ~/.julia/packages/LazyArrays/NYra8/src/lazyapplying.jl:333

Possible fix, define
  _copyto!(::LazyArrays.ApplyLayout{typeof(vcat)}, ::LazyArrays.ApplyLayout{typeof(vcat)}, ::AbstractArray{<:Any, N}, ::AbstractArray{<:Any, N}) where N

Stacktrace:
 [1] _copyto!(dest::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}}, src::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/4IG3b/src/ArrayLayouts.jl:234
 [2] copyto!(dest::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}}, src::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}})
   @ ArrayLayouts ~/.julia/packages/ArrayLayouts/4IG3b/src/ArrayLayouts.jl:235
 [3] copyto!
   @ ./broadcast.jl:967 [inlined]
 [4] copyto!
   @ ./broadcast.jl:926 [inlined]
 [5] materialize!
   @ ./broadcast.jl:884 [inlined]
 [6] materialize!
   @ ./broadcast.jl:881 [inlined]
 [7] materialize!(dest::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}}, x::ApplyArray{Int64, 1, typeof(vcat), Tuple{Vector{Int64}, Vector{Int64}}})
   @ Base.Broadcast ./broadcast.jl:877
 [8] top-level scope
   @ REPL[35]:1

On LazyArrays v0.22.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant