I just started using a new version of SBT, and when I went to run a test I got this SBT warning message:
I don’t remember the original source of this, “Warning, coyote activity,” but we have a lot of coyotes in Colorado, so I’ll be sure to keep an eye out for dangerous coyote activity. ;)
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.13, “Setting the SBT Log Level.”
You’re having a problem compiling, running, or packaging your project with SBT, and need to adjust the SBT logging level to debug the problem. (Or, you’re interested in learning about how SBT works.)
Set the SBT logging level in your build.sbt file with this setting:
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 14.1, “How to get started with the Scala REPL.”Back to top
You want to get started using the Scala REPL, including understanding some of its basic features, such as tab completion, starting the REPL with different options, and dealing with errors.Back to top
To start the Scala REPL, type
scala at your operating system command line:
Great, there have been rattlesnake sightings in the neighborhood. I knew there was a reason I wanted to move back to Alaska.
$ sbt compile [warn] there were 6 deprecation warnings; re-run with -deprecation for details [warn] there were 4 feature warnings; re-run with -feature for details
How do I ’re-run with -deprecation’ or ’re-run with -feature’?
Whenever I used to get the Scala REPL warning message, "There were deprecation warnings, re-run with -deprecation", I used to have to restart the REPL with the
-deprecation flag to see the warning message, like this:
$ scala -deprecation
That works, but sadly, you had to lose your entire REPL session to run it.
Thanks to the Scala gods, this is no longer necessary in Scala 2.10 (and newer). Now, when you get the REPL deprecation warning message, like this:
Scala match/case FAQ: Why am I getting an "unreachable code due to variable pattern" warning on my match/case statement when compiling my Scala code?
The usual reason for getting this error message is that you try to use an existing variable name inside a Scala match expression. For instance, if you try to create a match expression like this:
A sample Scala SBT build.sbt file, including the last line, which handles the SBT 're-run with -deprecation for details' warning message. (If you get the 're-run with -deprecation' message, that last line hands the "-deprecation" option over to the compiler, so you can see the deprecation problems.)