[Mono-bugs] [Bug 56819][Nor] New - Accessing an element out of range in an array returns null instead of throwing an IndexOutOfRangeException

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 11 Apr 2004 21:03:00 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by niel@bornstein.atlanta.ga.us.

http://bugzilla.ximian.com/show_bug.cgi?id=56819

--- shadow/56819	2004-04-11 21:03:00.000000000 -0400
+++ shadow/56819.tmp.8314	2004-04-11 21:03:00.000000000 -0400
@@ -0,0 +1,43 @@
+Bug#: 56819
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: Mac OS X 10.3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: niel@bornstein.atlanta.ga.us               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Accessing an element out of range in an array returns null instead of throwing an IndexOutOfRangeException
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Accessing an array element that does not exist returns null instead of
+throwing IndexOutOfRangeException.
+
+Steps to reproduce the problem:
+1. Compile and run:
+public class Test {
+  public static void Main(string [] args) {
+    System.Console.WriteLine(new string [] {} [0] == null);
+  ]
+}
+
+Actual Results:
+true
+
+Expected Results:
+IndexOutOfRangeException
+
+How often does this happen? 
+always
+
+Additional Information:
+Mono 0.31 on Mac OS X 10.3