[Mono-bugs] [Bug 77045][Nor] New - implementation of GetCustomAttributes() differs

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 20 11:14:48 EST 2005


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 borodin at zg.bezopasnost.ru.

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

--- shadow/77045	2005-12-20 11:14:48.000000000 -0500
+++ shadow/77045.tmp.12833	2005-12-20 11:14:48.000000000 -0500
@@ -0,0 +1,64 @@
+Bug#: 77045
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: borodin at zg.bezopasnost.ru               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: implementation of GetCustomAttributes() differs
+
+it seems Mono's implementation doesn't consider a interface as a valid
+return of GetCustomAttribute(System.Type, bool):
+
+the following code produces different output on mono-1.1.10 and MS.NET 1.1:
+
+using System.Reflection;
+
+namespace test
+{
+    public interface ISomeInterface
+    {
+        void operation();
+    }
+
+    public class AnAttribute: System.Attribute, ISomeInterface
+    {
+        public void operation()
+        {
+        }
+    }
+
+    [An]
+    public class tst
+    {
+        public bool member=true;
+
+        public static void Main()
+        {
+            tst t=new tst();
+
+            object[] attrs=t.GetType().GetCustomAttributes(
+                typeof(ISomeInterface),
+                true
+            );
+
+            System.Console.WriteLine("attrs.Length: {0}",attrs.Length);
+        }
+    }
+}
+
+output on mono-1.1.0:
+
+attrs.Length: 0
+
+output on MS.NET 1.1:
+attrs.Length: 1


More information about the mono-bugs mailing list