title: scala Ywarn-all usage
body: <p>I'm trying to use scala compiler Y warnings, but I don't think I'm doing it right. In the example below, nums is unused, hence I'd expect -Ywarn-value-discard to print a warning for that. 
  There are two if conditions, one nested inside the other. The child if's condition is exact opposite of parents', hence anything inside it is dead code. But -Ywarn-dead-code doesn't warn against that. 
  Could anyone please suggest what I might be doing wrong? Any pointers would be appreciated. </p>
  
  <pre><code>object DeadCodeWarn{
    def main( args: Array[ String ] ) {
      val nums = 1 to 100
      //There should be a warning for squares
      //as its a non-unit expression thats not
      //used in any computation. Y-warn-value-discard
      val squares = nums.map( x =&gt; x * x ) 
  
      if( nums.length == 100 ){
        println( "should be printed" )
        if( nums.length !=100 )
        {
          //-Ywarn-dead-code
          println( "Dead code, so should be warned against" )
        }
      }
    }
  }
  </code></pre>
  
  <p><code>$scalac -Xlint -Ywarn-all DeadCodeWarn.scala</code> succeeds silently. </p>