JuliaArrays / StructArrays.jl

Efficient implementation of struct arrays in Julia
https://juliaarrays.github.io/StructArrays.jl/
Other
327 stars 42 forks source link

Method ambiguities reported by Aqua #293

Open prbzrg opened 10 months ago

prbzrg commented 10 months ago

In Julia v1.10, I used Aqua to detect method ambiguities in my package https://github.com/impICNF/ContinuousNormalizingFlows.jl/issues/356 and some of its report were related to this package:

Ambiguity #99
reshape(s::StructArrays.StructArray{T}, d::Tuple{Vararg{Union{Colon, Integer}}}) where T @ StructArrays ~/.julia/packages/StructArrays/0h2SD/src/structarray.jl:476
reshape(parent::AbstractArray, shp::Tuple{Union{Integer, Base.OneTo}, Vararg{Union{Integer, Base.OneTo}}}) @ Base reshapedarray.jl:111

Possible fix, define
  reshape(::StructArrays.StructArray{T}, ::Tuple{Integer, Vararg{Integer}}) where T

Ambiguity #103
similar(s::StructArrays.StructArray, S::Type, sz::Tuple{Union{Integer, AbstractUnitRange}, Vararg{Union{Integer, AbstractUnitRange}}}) @ StructArrays ~/.julia/packages/StructArrays/0h2SD/src/structarray.jl:297
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}}) where T @ Base abstractarray.jl:837

Possible fix, define
  similar(::StructArrays.StructArray, ::Type{T}, ::Tuple{Integer, Vararg{Integer}}) where T

Ambiguity #104
similar(s::StructArrays.StructArray, S::Type, sz::Tuple{Union{Integer, Base.OneTo}, Vararg{Union{Integer, Base.OneTo}}}) @ StructArrays ~/.julia/packages/StructArrays/0h2SD/src/structarray.jl:297
similar(a::AbstractArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}}) where T @ Base abstractarray.jl:837

Possible fix, define
  similar(::StructArrays.StructArray, ::Type{T}, ::Tuple{Integer, Vararg{Integer}}) where T

I would appreciate your attention to this issue.