"Variable is assigned but its Value is never used" Warning
Posted by: Rick Strahls WebLog,
on 28 Feb 2009 |
View original | Bookmarked: 0 time(s)
Its late, but heres a little humor for ya. Ive been noticing recently that Ive been getting some odd warnings in Visual Studio for variables that are defined and never used. Check out the following screen shot from C# code editor: Notice how the compiler is warning about isSelected not being used, but as you can see just a few lines down it is in fact being used in an assignment. At first I thought that maybe the compiler knows something I dont know and figures the code in the if block never...