using System; public class Test { public static void Main() { int[] array = new int[1]; array[10] = GetVal(); } static int GetVal() { Console.WriteLine("GetVal"); return 0; } }
Standard input is empty
GetVal
Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Test.Main () [0x0000f] in <400fc174cd454372a6775bf6c054aae6>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Test.Main () [0x0000f] in <400fc174cd454372a6775bf6c054aae6>:0