[Mono-bugs] [Bug 46802][Nor] New - AttributeTargets.Interface not validated

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 23 Jul 2003 12:51:58 -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 lluis@ideary.com.

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

--- shadow/46802	Wed Jul 23 12:51:58 2003
+++ shadow/46802.tmp.23014	Wed Jul 23 12:51:58 2003
@@ -0,0 +1,48 @@
+Bug#: 46802
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lluis@ideary.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: AttributeTargets.Interface not validated
+
+Description of Problem:
+
+Custom attributes with AttributeTargets.Interface can currently be 
+applied to interface methods. mcs should give an error.
+
+Steps to reproduce the problem:
+Compile this:
+
+using System;
+
+public interface ITest
+{
+	[MyAttribute]
+	void Method();
+}
+
+[AttributeUsage (AttributeTargets.Interface)]
+class MyAttributeAttribute : Attribute
+{
+}
+
+Actual Results:
+Compilation Succeeded
+
+Expected Results:
+error CS0592: Attribute 'MyAttribute' is not valid on this
+declaration type. It is valid on 'interface' declarations only.
+
+How often does this happen? 
+Allways