我得到一个IllegalArgumentException: Can't find matching method: render, leave off hints for auto match
,但我需要类型提示来重载该方法。我错过了什么……?
(defprotocol LinkRendererProtocol
(render
[this node]
[this node text]
[this node url title text]
))
(deftype LinkRenderer [handlers]
LinkRendererProtocol
(render [this ^AutoLinkNode node]
(rendering :auto-link handlers node))
(render [this ^ExpLinkNode node text]
(rendering :exp-link handlers node text))
(render [this ^ExpImageNode node text]
(rendering :exp-image-link handlers node text))
(render [this ^MailLinkNode node]
(rendering :mail-link handlers node))
(render [this ^RefLinkNode node url title text]
(rendering :ref-link handlers node url title text))
(render [this ^RefImageNode node url title alt]
(rendering :ref-image handlers node url title alt))
(render [this ^WikiLinkNode node]
(rendering :wiki-link handlers node)))
(defn link-renderer
[handlers]
(LinkRenderer. (merge default-handlers handlers)))