title: Visual Studio 2015: Invalid "Cast is redundant" warning in interpolated string expression
body: <p>Consider this simple program which compiles fine in Visual Studio 2015:</p>
  
  <pre><code>public class Program
  {
      enum Direction
      {
          Up,
          Down,
          Left,
          Right
      }
  
      static void Main(string[] args)
      {
          // Old style
          Console.WriteLine(string.Format("The direction is {0}", Direction.Right));
          Console.WriteLine(string.Format("The direction is {0}", (int)Direction.Right));
  
          // New style
          Console.WriteLine($"The direction is {Direction.Right}");
          Console.WriteLine($"The direction is {(int)Direction.Right}");
      }
  }
  </code></pre>
  
  <p>... which outputs as expected:</p>
  
  <pre><code>The direction is Right
  The direction is 3
  The direction is Right
  The direction is 3
  </code></pre>
  
  <p>However, Visual Studio 2015 keeps suggesting a "Quick Action" on this line specifically:</p>
  
  <pre><code>// "Cast is redundant" warning
  Console.WriteLine($"The direction is {(int)Direction.Right}");
  </code></pre>
  
  <p>It insists that the <code>(int)</code> <em>"cast is redundant"</em>, and suggests as a potential fix to <em>"Remove Unnecessary Cast"</em>, which of course is wrong, as it would change the result.</p>
  
  <p>Interestingly, it doesn't give me any warning for the equivalent statement:</p>
  
  <pre><code>// No warnings.
  Console.WriteLine(string.Format("The direction is {0}", (int)Direction.Right));
  </code></pre>
  
  <p>Can someone provide a reasonable explanation for this false-positive when using an expression in an interpolated string?</p>