Skip to content

Commit d180775

Browse files
committed
Fix small bug from #16 so tests pass
The change lifted the scope of `note`, so it was being changed in the loop
1 parent bbdf869 commit d180775

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/utils.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ function showprov(io::IO, exs::AbstractVector;
4747
print(io, "\n\n")
4848
end
4949
k = kind(ex)
50-
if isnothing(note) # use provided `note` otherwise
51-
note = i > 1 && k == K"macrocall" ? "in macro expansion" :
52-
i > 1 && k == K"$" ? "interpolated here" :
53-
"in source"
50+
if isnothing(note)
51+
fallback_note = i > 1 && k == K"macrocall" ? "in macro expansion" :
52+
i > 1 && k == K"$" ? "interpolated here" :
53+
"in source"
5454
end
55-
highlight(io, sr; note=note, highlight_kwargs...)
55+
highlight(io, sr; note=something(note, fallback_note), highlight_kwargs...)
5656

5757
if include_location
5858
line, _ = source_location(sr)

0 commit comments

Comments
 (0)