【发布时间】:2012-10-28 07:37:24
【问题描述】:
我试图这样做:
(defprotocol TestP
(fun [this ^int i]))
(deftype Test [] TestP
(fun [this ^int i] i))
但是,编译失败并显示Can't find matching method: fun。这是否意味着 deftype 函数可能不接受参数类型提示?
【问题讨论】:
-
仅供参考。如果你想要静态类型的 Java 接口,你可以使用
definterface。 stackoverflow.com/questions/7770282/… -
非常感谢 tnoda,你的答案其实就是我一直在寻找的答案
标签: clojure