-
Notifications
You must be signed in to change notification settings - Fork 40
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
Zero + StaticVector is ambiguous #18
Comments
Here's the full error: julia> SVector(2,3) + Zeros(2)
ERROR: MethodError: +(::StaticArrays.SArray{Tuple{2},Int64,1,2}, ::FillArrays.Zeros{Float64,1,Tuple{Int64}}) is ambiguous. Candidates:
+(a::AbstractArray{T,N}, b::FillArrays.Zeros{V,N,SZ} where SZ) where {T, V, N} in FillArrays at /Users/sheehanolver/.julia/v0.6/FillArrays/src/FillArrays.jl:278
+(a::StaticArrays.StaticArray, b::AbstractArray) in StaticArrays at /Users/sheehanolver/.julia/v0.6/StaticArrays/src/linalg.jl:12
Possible fix, define
+(::StaticArrays.StaticArray{S,T,N} where S<:Tuple, ::FillArrays.Zeros{V,N,SZ} where SZ) |
Options:
I think we expect this to return an |
I'm going to do (3) for now and we can come back to this later. |
Ah, yeah. I agree regarding possible solutions. 1 and 2 are only partial fixes though, as we'll keep running into this ambiguity with every other |
This is a case where |
FWIW, the julia> @btime $(SVector(2,3)) + $(Zeros(2))
5.028 ns (0 allocations: 0 bytes)
2-element StaticArrays.SArray{Tuple{2},Float64,1,2}:
2.0
3.0
julia>
julia> @btime identity($(SVector(2,3)))
2.025 ns (0 allocations: 0 bytes)
2-element StaticArrays.SArray{Tuple{2},Int64,1,2}:
2
3 |
On master,
@willtebbutt
The text was updated successfully, but these errors were encountered: