Skip to content

Unable to to detect unbounded type parameters enclosed in Type #333

@frankwswang

Description

@frankwswang

Define a minimal module in AquaTest.jl:

module AquaTest

export get_ele_T

get_ele_T(::Type{<:Array{T}}) where {T} = T

end

Then run the following code in REPL started in the same directory:

julia> begin
           push!(LOAD_PATH, ".")
           using AquaTest
           using Aqua
       end

julia> Aqua.test_unbound_args(AquaTest)
Test Passed

julia> get_ele_T(Union{})
ERROR: UndefVarError: `T` not defined in static parameter matching
Suggestion: run Test.detect_unbound_args to detect method arguments that do not fully constrain a type parameter.

It seems that Aqua.jl (v0.8.12) ignored the edge case of Union{} isa Type{<:Array{T}} where {T}.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions