-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Labels
Milestone
Description
julia> svec = SVector([1,2], [1,2])
julia> reduce(vcat, svec)
ERROR: MethodError: reduce(::typeof(hcat), ::SArray{Tuple{2},Array{Int64,1},1,2}) is ambiguous. Candidates:
reduce(op, a::StaticArray) in StaticArrays at /home/colinxs/.julia/packages/StaticArrays/VyRz3/src/mapreduce.jl:168
reduce(::typeof(hcat), A::AbstractArray{#s72,1} where #s72<:(Union{AbstractArray{T,1}, AbstractArray{T,2}} where T)) in Base at abstractarray.jl:1324
Possible fix, define
reduce(::typeof(hcat), ::StaticArray{S,#s72,1} where S<:Tuple where #s72<:(Union{AbstractArray{T,1}, AbstractArray{T,2}} where T))
This is on StaticArrays 0.11 and Julia 1.1.1. As far as I've seen this only happens for vcat/hcat.
I believe it's related to JuliaLang/julia#27188 when specializations were added for vcat and hcat.