How to get more information about 'feature' flag warning?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 09:59:09

问题


When compiling an application with Play2, sometimes these kind of message appears on my terminal :

[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

How can I get more information about those warning? It must be an option of sbt but I have no idea where to search...


回答1:


To see the exact message you need to add "feature" flag in your sbt build definition file:

scalacOptions ++= Seq("-feature")

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.



来源:https://stackoverflow.com/questions/15533706/how-to-get-more-information-about-feature-flag-warning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!