See anything wrong with the code below? I didn't until Visual Studio gave me a nice squiggly red line indicating something was wrong. IList aList = new List (); foreach (A a in aList) { // Do something } A a = new A(); This is the error: A local variable