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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78020 --- shadow/78020 2006-04-05 04:16:22.000000000 -0400 +++ shadow/78020.tmp.3344 2006-04-05 04:16:22.000000000 -0400 @@ -0,0 +1,98 @@ +Bug#: 78020 +Product: Mono: Compilers +Version: 1.1 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Mcs Custom Attribute Handling + +Description of Problem: +====================== + +Recent version(s) of mcs (1.1.14 and may be earlier) introduce a bug custom +attribute handling. In a declaration of the form + +class SomeClass { + [SomeCustomAttribute] int x, y; +} + +the field 'x' does not have any 'SomeCustomAttribute' attached to it, +but the field 'y' does have two 'SomeCustomAttribute' attached to it. + +Steps to reproduce the problem: Compile the following: +===================================================== + +using System; +using System.Reflection; + +[AttributeUsage(AttributeTargets.Field)] +class SomeCustomAttribute : Attribute { + public SomeCustomAttribute () + { + } +} + +class MainClass { + + // Here, the custom attribute is attached correctly + [SomeCustomAttribute] + public int a; + + // Here, the custom attribute attachment has a flaw + [SomeCustomAttribute] + public int x, y; + + public static void Main () + { + Type t = typeof (MainClass); + FieldInfo[] fia = t.GetFields(); + + foreach (FieldInfo fi in fia) { + object[] ca = fi.GetCustomAttributes(false); + System.Console.WriteLine ("Field: {0} [{1}]", fi.Name, ca.Length); + foreach (Attribute a in ca) + System.Console.WriteLine (" Attribute: {0}", a); + } + } + +} + + +Actual Results: +============== + +Field: a [1] + Attribute: SomeCustomAttribute +Field: x [0] +Field: y [2] + Attribute: SomeCustomAttribute + Attribute: SomeCustomAttribute + +Expected Results: +================ + +Field: a [1] + Attribute: SomeCustomAttribute +Field: x [1] + Attribute: SomeCustomAttribute +Field: y [1] + Attribute: SomeCustomAttribute + +How often does this happen? +========================== + +Anytime, behaviour is deterministic. + +Additional Information: +====================== +None. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
