什么是“应该启用结构类型成员方法的反射访问..."?Scala 中的警告是什么意思? [英] What does "reflective access of structural type member method should be enabled..." warning mean in Scala?
本文介绍了什么是“应该启用结构类型成员方法的反射访问..."?Scala 中的警告是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
切换到 Scala 2.10 后,我收到了大量警告:
After switching to Scala 2.10 I get tons of warnings:
结构类型成员方法的反射访问...应该通过使隐式值 language.reflectiveCalls 可见来启用
reflective access of structural type member method ... should be enabled by making the implicit value language.reflectiveCalls visible
这是什么意思?
推荐答案
警告实际上告诉了在文档中查找解释的位置:
The warning actually tells where to look in the documentation for an explanation:
Test.scala:9: warning: reflective access of structural type member method y should be enabled
by making the implicit value language.reflectiveCalls visible.
This can be achieved by adding the import clause 'import scala.language.reflectiveCalls'
or by setting the compiler option -language:reflectiveCalls.
See the Scala docs for value scala.language.reflectiveCalls for a discussion
why the feature should be explicitly enabled.
参考 Scaladoc 条目(请务必单击 |> 向左的箭头以展开文档条目).
Referenced Scaladoc entry (be sure to click the |> arrow to the left to expand the documentation entry).
这篇关于什么是“应该启用结构类型成员方法的反射访问..."?Scala 中的警告是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文