Skip to content

Commit d1549b9

Browse files
committed
don't print parentheses for empty args
1 parent 5a2cdb0 commit d1549b9

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/ClearStacktrace.jl

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,23 @@ function print_frame(io, i, func, inlined, modul, file, line, stypes,
123123
# function name
124124
printstyled(io, func, bold = true)
125125

126-
# type signature
127-
printstyled(io, "(", color = :light_black)
128-
129-
i = 1
130-
for (stype, (varname, vartype)) in zip(stypes, args)
131-
if i > 1
132-
printstyled(io, ", ", color = :light_black)
126+
if !isempty(args)
127+
# type signature
128+
printstyled(io, "(", color = :light_black)
129+
130+
i = 1
131+
for (stype, (varname, vartype)) in zip(stypes, args)
132+
if i > 1
133+
printstyled(io, ", ", color = :light_black)
134+
end
135+
printstyled(io, string(varname), color = :light_black, bold = true)
136+
printstyled(io, "::")
137+
printstyled(io, string(stype), color = :light_black)
138+
i += 1
133139
end
134-
printstyled(io, string(varname), color = :light_black, bold = true)
135-
printstyled(io, "::")
136-
printstyled(io, string(stype), color = :light_black)
137-
i += 1
138-
end
139140

140-
printstyled(io, ")", color = :light_black)
141+
printstyled(io, ")", color = :light_black)
142+
end
141143

142144
println(io)
143145

0 commit comments

Comments
 (0)