Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression (crash) in showing empty method list #45879

Closed
vtjnash opened this issue Jun 30, 2022 · 1 comment · Fixed by #45883
Closed

regression (crash) in showing empty method list #45879

vtjnash opened this issue Jun 30, 2022 · 1 comment · Fixed by #45883
Labels
regression Regression in behavior compared to a previous version
Milestone

Comments

@vtjnash
Copy link
Member

vtjnash commented Jun 30, 2022

julia> struct NOP{P} end

julia> methods(NOP)
# 0 methods for type constructorError showing value of type Base.MethodList:
ERROR: BoundsError: attempt to access 0-element Vector{Method} at index [1]
Stacktrace:
  [1] getindex
    @ ./essentials.jl:13 [inlined]
  [2] show_method_table(io::IOContext{Base.TTY}, ms::Base.MethodList, max::Int64, header::Bool)
    @ Base ./methodshow.jl:296
  [3] show_method_table
    @ ./methodshow.jl:282 [inlined]
  [4] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, ms::Base.MethodList)
    @ Base ./methodshow.jl:342

julia> @test sprint(show, Base.MethodList(Method[], typeof(NOP).name.mt)) isa String
@JeffBezanson JeffBezanson added the regression Regression in behavior compared to a previous version label Jun 30, 2022
@ianatol
Copy link
Member

ianatol commented Jun 30, 2022

Bisected to b2b8ce8 (#45069)

Specifically this line assumes a non-empty MethodList

CC @Seelengrab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants