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

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 5 May 2003 06:21:08 -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	Mon May  5 00:25:49 2003
+++ shadow/42216.tmp.22945	Mon May  5 06:21:08 2003
@@ -1,13 +1,13 @@
 Bug#: 42216
 Product: Mono/MCS
 Version: unspecified
 OS: other
 OS Details: 
-Status: RESOLVED   
-Resolution: FIXED
+Status: REOPENED   
+Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: Misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: lupus@ximian.com               
 QAContact: mono-bugs@ximian.com
@@ -42,6 +42,36 @@
 ------- Additional Comments From miguel@ximian.com  2003-05-05 00:24 -------
 The code now reports an error in that case (just like the MS runtime does)
 
 ------- Additional Comments From miguel@ximian.com  2003-05-05 00:25 -------
 Am closing this bug, unless I missed the point.  null arguments to an
 attribute for an object argument is apparently invalid.
+
+------- Additional Comments From lupus@ximian.com  2003-05-05 06:21 -------
+Reopening, since mcs still compiles the test case (forgot to commit
+something?).
+The sample compiles fine with csc from .net 1.0, so maybe you should
+issue an error only if -v2 is specified?
+The original bug is still there, though, just change the type to the
+attribute ctor to string: the attribute is not emitted by mcs.
+
+[AttributeUsage (AttributeTargets.All)]
+public class MineAttribute : Attribute {
+        public MineAttribute (string 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;
+        }
+}
+
+
+
+