[Mono-bugs] [Bug 63841][Nor] New - Type.GetElementType doesn't return null when expected

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 24 Aug 2004 11:48:11 -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 priewasser@gmx.at.


--- shadow/63841	2004-08-24 11:48:11.000000000 -0400
+++ shadow/63841.tmp.2320	2004-08-24 11:48:11.000000000 -0400
@@ -0,0 +1,44 @@
+Bug#: 63841
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: priewasser@gmx.at               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Type.GetElementType doesn't return null when expected
+Description of Problem:
+Type.GetElementType() returns not null if the current Type is not an array 
+or a pointer, or is not passed by reference, but the Type self.
+Steps to reproduce the problem:
+Run this:
+using System;
+class TestGetElementType {
+    public static void Main() {
+        TestGetElementType newMe = new TestGetElementType();
+        Type t = newMe.GetType();
+        Type t2 = t.GetElementType();
+        Console.WriteLine("The element type of {0} is {1}.", newMe, 
+t2==null? "null" : t2.ToString());
+    }
+Actual Results:
+TestType element type is TestType
+Expected Results:
+TestType element type is null
+Additional Information:
+Testcase taken from Mono Documentation Library (slightly modified)