Skip to content

edge creation mistake #56577

Closed
Closed
@vtjnash

Description

@vtjnash

Looking at why some code wasn't loading correctly, I found this edge list isn't being generated correctly for nteltype(::Type) with 3 entries present for it where there should only be at most one of a different kind (method table rather than call and widened invoke given the resulting code), though preferable this would be zero edges:

julia> code_typed(eltype, (Type{A} where A<:(NamedTuple{names, T} where T<:Tuple{Vararg{Any, N}} where names where N),))[2][1].edges
7-element Vector{Any}:
 2
  Tuple{typeof(Base.nteltype), Type{A} where A<:(NamedTuple{names, T} where {N, names, T<:NTuple{N, Any}})}
  CodeInstance for MethodInstance for Base.nteltype(::Type{NamedTuple{names, T}} where names) where {N, T<:NTuple{N, Any}}
  nteltype(::Type) @ Base namedtuple.jl:230
  MethodInstance for Base.nteltype(::Type{A} where A<:(NamedTuple{names, T} where {N, names, T<:NTuple{N, Any}}))
  Tuple{typeof(Base.nteltype), Type}
  MethodInstance for Base.nteltype(::Type)

julia> code_typed(eltype, (Type{A} where A<:(NamedTuple{names, T} where T<:Tuple{Vararg{Any, N}} where names where N),))[2][1]
CodeInfo(
    @ namedtuple.jl:229 within `eltype`
1%1 = $(Expr(:static_parameter, 1))::Type{A} where A<:(NamedTuple{names, T} where {N, names, T<:NTuple{N, Any}})%2 =   dynamic Base.nteltype(%1)::Any
└──      return %2
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions