From fc807f2a054136610e2c9b7752906eed4ed3ad2e Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Thu, 8 Oct 2026 12:12:35 -0400 Subject: [PATCH] Fix method ambiguity in similar(::AbstractVectorOfArray, ::Type, dims) on Julia 1.10 Making AbstractVectorOfArray <: AbstractArray (#547) made RAT's similar(VA::AbstractVectorOfArray, ::Type{T}, dims::Tuple{Union{Integer,Base.OneTo}, Vararg{...}}) ambiguous with Base.similar(a::AbstractArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}}), a Base fallback method that exists on Julia 1.10/1.11 but was removed in 1.12. This was masked by the Aqua ambiguities exemption until #648 removed it, so GROUP=QA on Julia 1.10 (the "lts" CI matrix entry) started failing on master. Adds the more specific Integer-only method Aqua's own diagnostic suggested, mirroring the analogous pair of methods Base itself defines, resolving the ambiguity without an Aqua exclusion. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Agent-Harness: Claude Code Agent-Model: claude-sonnet-5 Agent-Session: https://claude.ai/code/session_01LPHREnnonfLg1VcE1EJovv --- src/vector_of_array.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index af4da6e9..0ca19a09 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -1162,6 +1162,16 @@ end ) where {T} return similar(Array{T}, dims) end +# On Julia versions where Base.similar(::AbstractArray, ::Type, ::Tuple{Integer, +# Vararg{Integer}}) still exists (removed upstream in 1.12), that method and the +# one above are each more specific than the other in one argument position, +# which Aqua reports as an ambiguity. Pin down the Integer-only intersection +# explicitly, mirroring the equivalent pair of methods Base itself defines. +@inline function Base.similar( + VA::AbstractVectorOfArray, ::Type{T}, dims::Tuple{Integer, Vararg{Integer}} + ) where {T} + return similar(Array{T}, dims) +end # fill!