Skip to content

Commit

Permalink
Fix #46594: Show on method with Vararg (#46710)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen authored Sep 12, 2022
1 parent 9e8fb63 commit 7e51510
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function strip_gensym(sym)
end

function argtype_decl(env, n, @nospecialize(sig::DataType), i::Int, nargs, isva::Bool) # -> (argname, argtype)
t = sig.parameters[unwrapva(min(i, end))]
t = unwrapva(sig.parameters[min(i, end)])
if i == nargs && isva
va = sig.parameters[end]
if isvarargtype(va) && (!isdefined(va, :N) || !isa(va.N, Int))
Expand Down
6 changes: 6 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,12 @@ let repr = sprint(show, "text/html", methods(f16580))
@test occursin("f16580(x, y...; <i>z, w, q...</i>)", repr)
end

# Just check it doesn't error
f46594(::Vararg{T, 2}) where T = 1
let repr = sprint(show, "text/html", first(methods(f46594)))
@test occursin("f46594(::Vararg{T, 2}) where T", replace(repr, r"</?[A-Za-z]>"=>""))
end

function triangular_methodshow(x::T1, y::T2) where {T2<:Integer, T1<:T2}
end
let repr = sprint(show, "text/plain", methods(triangular_methodshow))
Expand Down

9 comments on commit 7e51510

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@vtjnash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

@vtjnash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nanosoldier runbenchmarks("inference"||"micro"||misc", vs="@ b8336b362bdbba92f0edab077d74fbd7b61ce818")

@Keno
Copy link
Member

@Keno Keno commented on 7e51510 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilePathsBase is fixed, let's see if PkgEval is recovered: @nanosoldier runtests(["FilePathsBase"])

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible issues were detected. A full report can be found here.

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC running without BugReporting should still work:

@nanosoldier runtests(["FilePathsBase"], configuration = (rr=false,))

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - no issues were detected. A full report can be found here.

Please sign in to comment.