Skip to content

Test.has_unbound_vars should show some respect for history #28086

@timholy

Description

@timholy

EDIT: it's not entirely obvious this is a bug. Below the key comparison is reduced to

foo1(::Type{Tuple{R1,Vararg{R1,N}}}) where {N,T1,R1<:AbstractUnitRange{T1}}

vs

foo2(::Type{NTuple{N,R1}}) where {N,T1,R1<:AbstractUnitRange{T1}}

I think that what this really comes down to is

julia> Tuple{} <: NTuple{0, T} where T<:AbstractUnitRange
true

original post

julia> using Test

julia> foo(::Type{NTuple{N,R1}}, ::Type{NTuple{N,R2}}) where {N,R1<:AbstractUnitRange{T1},R2<:AbstractUnitRange{T2}} where {T1,T2} =
           NTuple{N,promote_type(R1,R2)}
foo (generic function with 1 method)

julia> m = first(Base.MethodList(typeof(foo).name.mt))
foo(::Type{Tuple{Vararg{R1,N}}}, ::Type{Tuple{Vararg{R2,N}}}) where {T1, T2, N, R1<:AbstractUnitRange{T1}, R2<:AbstractUnitRange{T2}} in Main at REPL[2]:1

julia> Test.has_unbound_vars(m.sig)
true

I think it's fair to say that method definition does not have unbound typevars. I am guessing this is a consequence of the loop dropping old typevars.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsystemThe unit testing framework and Test stdlibtypes and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions