24

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...

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
i.am.michiel
  • 10,281
  • 7
  • 50
  • 86
  • 3
    It is effect of SIP-18 http://docs.scala-lang.org/sips/pending/modularizing-language-features.html to the see warning add this flag in your sbt definition: `scalacOptions ++= Seq(... "-feature")` – om-nom-nom Mar 20 '13 at 20:12
  • Indeed! That worked, thanks! Would you mind suggesting an answer with that? – i.am.michiel Mar 20 '13 at 20:51
  • 1
    @i.am.michiel Exactly which file did you add it in PlayFramework 2? I am triying to add `scalacOptions ++= Seq("-unchecked", "-deprecation","-feature")` to Build.scala but it doesn't seem to have any effect. – Umut Benzer May 10 '13 at 14:43
  • I added to build.sbt, but I'm using Play 2.3.x – David Scruggs Jun 04 '14 at 16:45
  • @UmutBenzer I had the same, no effect if it was alongside the other flags in 'build.sbt'. If I made a line for it itself (using ++=) I got the warnings. Weird. – akauppi Aug 08 '14 at 12:30

1 Answers1

43

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.

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
om-nom-nom
  • 62,329
  • 13
  • 183
  • 228