We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
similar
StaticArrays
julia> v = StructArray{Complex{Int}}((SA[1,2], SA[1,2])) 2-element StructArray(::SVector{2, Int64}, ::SVector{2, Int64}) with eltype Complex{Int64} with indices SOneTo(2): 1 + 1im 2 + 2im julia> similar(v) ERROR: MethodError: similar(::StructVector{Complex{Int64}, @NamedTuple{re::SVector{2, Int64}, im::SVector{2, Int64}}, Int64}, ::Type{Complex{Int64}}, ::Tuple{SOneTo{2}}) is ambiguous. Candidates: similar(s::StructArray, S::Type, sz::Tuple{Union{Integer, AbstractUnitRange}, Vararg{Union{Integer, AbstractUnitRange}}}) @ StructArrays ~/.julia/packages/StructArrays/dNQpc/src/structarray.jl:297 similar(A::AbstractArray, ::Type{T}, shape::Union{Tuple{SOneTo, Vararg{Union{Integer, Base.OneTo, SOneTo}}}, Tuple{Union{Integer, Base.OneTo}, SOneTo, Vararg{Union{Integer, Base.OneTo, SOneTo}}}, Tuple{Union{Integer, Base.OneTo}, Union{Integer, Base.OneTo}, SOneTo, Vararg{Union{Integer, Base.OneTo, SOneTo}}}}) where T @ StaticArrays ~/.julia/packages/StaticArrays/80e5O/src/abstractarray.jl:149 Possible fix, define similar(::StructArray, ::Type{T}, ::Union{Tuple{SOneTo, Vararg{Union{Integer, Base.OneTo, SOneTo}}}, Tuple{Union{Integer, Base.OneTo}, SOneTo, Vararg{Union{Integer, Base.OneTo, SOneTo}}}, Tuple{Union{Integer, Base.OneTo}, Union{Integer, Base.OneTo}, SOneTo, Vararg{Union{Integer, Base.OneTo, SOneTo}}}}) where T Stacktrace: [1] similar(a::StructVector{Complex{Int64}, @NamedTuple{re::SVector{2, Int64}, im::SVector{2, Int64}}, Int64}, ::Type{Complex{Int64}}) @ Base ~/julia/base/abstractarray.jl:827 [2] similar(a::StructVector{Complex{Int64}, @NamedTuple{re::SVector{2, Int64}, im::SVector{2, Int64}}, Int64}) @ Base ~/julia/base/abstractarray.jl:826 [3] top-level scope @ REPL[6]:1
Perhaps an extension may help here
The text was updated successfully, but these errors were encountered:
axes
Diagonal
I also encountered this recently! What do you think is the best approach here?
StructArrays.jl/src/structarray.jl
Lines 288 to 291 in 0b99716
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Perhaps an extension may help here
The text was updated successfully, but these errors were encountered: