[Mono-bugs] [Bug 42216][Nor] New - some custom attributes get ignored by mcs

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 1 May 2003 13:43:50 -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 lupus@ximian.com.

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

--- shadow/42216	Thu May  1 13:43:49 2003
+++ shadow/42216.tmp.5323	Thu May  1 13:43:49 2003
@@ -0,0 +1,40 @@
+Bug#: 42216
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: some custom attributes get ignored by mcs
+
+In the following test, mcs won't emit the custom attribute
+(tested also on the ms runtime).
+using System;
+using System.Reflection;
+
+[AttributeUsage (AttributeTargets.All)]
+public class MineAttribute : Attribute {
+        public MineAttribute (object o)
+        {
+        }
+}
+
+[Mine(null)]
+public class Foo {
+        public static int Main ()
+        {
+                object[] attrs = typeof (Foo).GetCustomAttributes
+(typeof(MineAttribute), true);
+                MineAttribute ma = (MineAttribute) attrs [0];
+                return 0;
+        }
+}