[Mono-bugs] [Bug 58688][Nor] New - MCS does not report error when the same attribute is assigned twice

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 19 May 2004 03:56:04 -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 gert.driesen@pandora.be.

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

--- shadow/58688	2004-05-19 03:56:04.000000000 -0400
+++ shadow/58688.tmp.2403	2004-05-19 03:56:04.000000000 -0400
@@ -0,0 +1,55 @@
+Bug#: 58688
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS does not report error when the same attribute is assigned twice
+
+mcs does not report error CS0579 when an Attribute with AllowMultiple set 
+to false is assigned to a member more than once.
+
+using System;
+
+[assembly:CLSCompliant(true)]
+
+namespace DuplicateAttributes {
+	[CLSCompliant(true)]
+	[CLSCompliant(true)]
+	public class ClassA {
+		[CLSCompliant(true)]
+		[CLSCompliant(true)]
+		public ClassA() {
+		}
+
+		[CLSCompliant(true)]
+		[CLSCompliant(true)]
+		public void Method() {
+		}
+
+		[CLSCompliant(true)]
+		[CLSCompliant(true)]
+		public string Test {
+			get { return ""; }
+		}
+	}
+}
+
+This results in the following errors on csc :
+
+test.cs(7,3): error CS0579: Duplicate 'CLSCompliant' attribute
+test.cs(10,4): error CS0579: Duplicate 'CLSCompliant' attribute
+test.cs(15,4): error CS0579: Duplicate 'CLSCompliant' attribute
+test.cs(20,4): error CS0579: Duplicate 'CLSCompliant' attribute
+
+while mcs does not report any error at all.