Skip to content

Commit 01ad137

Browse files
authored
Merge pull request #246 from JuliaDebug/sds/fix_245
fix #245: error in limited callinfo printing
2 parents a302511 + 348c522 commit 01ad137

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/callsite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ end
238238

239239
function show_callinfo(limiter, ci::Union{MultiCallInfo, FailedCallInfo, GeneratedCallInfo})
240240
types = (ci.sig::DataType).parameters
241-
ft, tt... = types
241+
ft, tt = types[1], types[2:end]
242242
f = Compiler.singleton_type(ft)
243243
if f !== nothing
244244
name = "$f"

test/runtests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ end
701701

702702
include("terminal.jl")
703703

704-
using Cthulhu: MultiCallInfo, show_callinfo, CallInfo
704+
using Cthulhu: MultiCallInfo, show_callinfo, CallInfo, TextWidthLimiter
705705

706706
@testset "printing of MultiCallInfo" begin
707707
# PR 226
@@ -716,4 +716,7 @@ using Cthulhu: MultiCallInfo, show_callinfo, CallInfo
716716
@test sprint(show_callinfo, ci) == "→ (::Foo)(::Float64)::Float64"
717717
ci = MultiCallInfo(Tuple{Union{m.Foo, m.Bar}, Float64}, Float64, CallInfo[])
718718
@test sprint(show_callinfo, ci) == "→ (::Union{Bar, Foo})(::Float64)::Float64"
719+
ci = MultiCallInfo(Tuple{m.Foo, Vararg{Float64, 30}}, Float64, CallInfo[])
720+
@test sprint(io -> show_callinfo(TextWidthLimiter(io, 80), ci)) ==
721+
"→ (::Foo)(…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…,…)::…"
719722
end

0 commit comments

Comments
 (0)