Skip to content

apply_any gets specialized despite annotations to the contrary #31565

@timholy

Description

@timholy

After running the JuliaInterpreter tests, I get this:

julia> m = first(methods(Base.append_any))
append_any(xs...) in Base at essentials.jl:663

julia> m.specializations.func
MethodInstance for append_any(::Vararg{Any,N} where N)

julia> m.specializations.next.func
MethodInstance for append_any(::Tuple{Any}, ::Vararg{Any,N} where N)

julia> m.specializations.next.next.func
MethodInstance for append_any(::Any, ::Vararg{Any,N} where N)

This is despite the intention to avoid specialization:

julia/base/essentials.jl

Lines 662 to 663 in b073bb5

function append_any(xs...)
@nospecialize
Unfortunately, this isn't fixed by changing the declaration to

function append_any(@nospecialize xs...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions