Skip to content

Commit

Permalink
correct printing of a IRCode that returns nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
contra-bit committed Jul 12, 2024
1 parent 392c8dc commit cae04aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ function Base.show(io::IO, ::MIME"text/plain", g::Chain)
print(io, ")")
end

function Base.show(io::IO, x::IRCode)
if x.stmts.stmt[1] isa Core.ReturnNode
printstyled(io, nothing)
else
printstyled(io, x)
end
end

0 comments on commit cae04aa

Please sign in to comment.