Skip to content

Commit

Permalink
Improved warning for term method with orgdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
tecosaur committed Feb 20, 2024
1 parent 23a27d2 commit 7ec8d9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/render/term.jl
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,10 @@ end
# Catchall
# ---------------------

function term(io::IO, component::Component)
@warn "No method for converting $(typeof(component)) to a term representation currently exists"
function term(io::IO, component::C) where {C <: Component}
but = if hasmethod(term, Tuple{IO, OrgDoc, C})
", but a term(::IO, ::OrgDoc, ::$C) method is defined"
else "" end
@warn "No method for converting $C to a term representation currently exists$but"
print(io, component, '\n')
end

0 comments on commit 7ec8d9d

Please sign in to comment.