Skip to content

Commit

Permalink
fix unionall env in showing nested method static parameters (JuliaLan…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Dec 16, 2018
1 parent 01fe7c2 commit 36cc20c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion base/methodshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,16 @@ function show_method_params(io::IO, tv)
if length(tv) == 1
show(io, tv[1])
else
show_delim_array(io, tv, '{', ',', '}', false)
print(io, "{")
for i = 1:length(tv)
if i > 1
print(io, ", ")
end
x = tv[i]
show(io, x)
io = IOContext(io, :unionall_env => x)
end
print(io, "}")
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ let repr = sprint(show, "text/html", methods(f16580))
@test occursin("f16580(x, y...; <i>z, w, q...</i>)", repr)
end

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

if isempty(Base.GIT_VERSION_INFO.commit)
@test occursin("https://github.com/JuliaLang/julia/tree/v$VERSION/base/special/trig.jl#L", Base.url(which(sin, (Float64,))))
else
Expand Down

0 comments on commit 36cc20c

Please sign in to comment.