fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. foreach(var i in new[]{1, 2, 3}) {
  8. int s = i;
  9. }
  10.  
  11. int s = 4;
  12. }
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
stdout
Standard output is empty