查找隐式转换
我正在寻找一种找到隐式转换的方法。给我提供从一种类型到另一种类型的转换的包的东西。
举个例子:
found : java.lang.String("")
required: net.liftweb.http.js.JsExp
在 Scaladoc 中进行一些搜索后,我找到了带有隐式转换的包。没有一些自动化的方法来进行此搜索吗?
编辑:我不太擅长制定。我的问题是找出我必须导入哪个包。当使用隐式转换时,IDE 已显示。但有时我相信某个地方应该存在隐式转换,但不知道在哪个包中。
I'm searching a way to find implicit conversion. Something which give me the packages where a conversion from one to the other type is.
As an example:
found : java.lang.String("")
required: net.liftweb.http.js.JsExp
After some searching in the Scaladoc i found the package with the implicit conversion. Isn't there some automated way to do this search?
Edit: I'm not so good at formulating. My problem is to find out which package i have to import. The IDE already displays when an implicit conversion is used. But sometimes i believe that somewhere a implicit conversion should exist but have no clue in which package.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Scala 项目的 NetBeans 插件允许您将 Ctrl 鼠标悬停在某个值上以查看已应用的任何隐式转换。当尝试编译代码时,您还可以使用一些编译器调试选项;我想这里 -Xlog-implicits 可能就是您正在寻找的。可以在这里找到更多有用的编译器标志: http://www.paulbutcher .com/2010/04/scala-compiler-advanced-options/
The NetBeans plugin for Scala projects will allow you Ctrl-hover over a value to see any implicit conversions that have been applied. You can also use some of the compiler debugging options when attempting to compile your code; I think here -Xlog-implicits might be what you're looking for. More useful compiler flags can be found here: http://www.paulbutcher.com/2010/04/scala-compiler-advanced-options/