How to get more information about #39;feature#39; flag warning?(如何获取有关“功能标志警告的更多信息?)
问题描述
使用 Play2 编译应用程序时,有时我的终端上会出现以下消息:
When compiling an application with Play2, sometimes these kind of message appears on my terminal :
[info] 将 1 个 Scala 源代码编译到 ~/target/scala-2.10/classes...
[警告] 有 1 个功能警告;使用 -feature 重新运行以了解详细信息
[警告] 发现一个警告
[成功] 1s编译完成
[info] Compiling 1 Scala source to ~/target/scala-2.10/classes...
[warn] there were 1 feature warnings; re-run with -feature for details
[warn] one warning found
[success] Compiled in 1s
如何获得有关这些警告的更多信息?它必须是 sbt 的一个选项,但我不知道在哪里搜索......
How can I get more information about those warning? It must be an option of sbt but I have no idea where to search...
推荐答案
要查看确切的消息,您需要在 sbt 构建定义文件中添加feature"标志:
To see the exact message you need to add "feature" flag in your sbt build definition file:
scalacOptions ++= Seq("-feature")
为什么?Scala 2.10 不仅引入了新特性,还重新调整了旧特性——一些最强大的 scala 特性被隐藏了,因为它们应该以极大的责任感来使用:有时他们被错误地使用了.这就是 SIP-18 出现的原因.从现在开始,要访问动态、高级类型、存在类型和其他一些东西,您必须显式启用它们.
Why? Scala 2.10 not only introduced new features, but also reshuffled older ones -- some of the most powerful scala features were hidden because they should be used with great responsibility: sometimes they were used mistakingly. That is why SIP-18 has arised. From now on, to access dynamics, higher kinds, existential types and some other things you have to explicitly enable them.
这篇关于如何获取有关“功能"标志警告的更多信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何获取有关“功能"标志警告的更多信息?
基础教程推荐
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01