如何获取有关“功能"标志警告的更多信息?

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.

这篇关于如何获取有关“功能"标志警告的更多信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何获取有关“功能"标志警告的更多信息?

基础教程推荐