为什么在尝试从另一个命名空间导入协议或记录时会出现 IllegalAccessError
我的项目中有一个文件,其中定义了一些协议和记录(defprotocol
和 defrecord
)。
我试图在不同的文件/命名空间中使用它们,如下所示:
(ns myapp.core
(:require [myapp.protocols :refer [SomeProtocol]]))
这会导致 执行错误 (IllegalAccessError) at ....
有谁知道为什么吗?
顺便说一句,执行 :refer :all
确实有效,但我不想将几个不需要的符号引入命名空间。
谢谢
I have a file in my project where I define a few protocols and records (defprotocol
and defrecord
).
I'm trying to use them in a different file/namespace like this:
(ns myapp.core
(:require [myapp.protocols :refer [SomeProtocol]]))
This causes an Execution error (IllegalAccessError) at ....
Does anyone know why?
btw, doing :refer :all
does work but I don't want to bring in several unneeded symbols into the namespace.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论