using System; public class Test{ public static void Main() { foreach(var i in new[]{1, 2, 3}) { int s = i; } int s = 4; }}
Standard input is empty
prog.cs(11,7): error CS0136: A local variable named `s' cannot be declared in this scope because it would give a different meaning to `s', which is already used in a `child' scope to denote something else Compilation failed: 1 error(s), 0 warnings
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!