[Mono-bugs] [Bug 47448][Wis] New - MCS fails to identify and report missing mandatory parameters to attributes

bugzilla-daemon@indri.ximian.com bugzilla-daemon@indri.ximian.com
Sat, 9 Aug 2003 20:25:45 -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 larsde@key2network.com.

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

--- shadow/47448	2003-08-09 20:25:45.000000000 -0400
+++ shadow/47448.tmp.2885	2003-08-09 20:25:45.000000000 -0400
@@ -0,0 +1,66 @@
+Bug#: 47448
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: larsde@key2network.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS fails to identify and report missing mandatory parameters to attributes
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+MCS fails to flag a condition where an attribute has a mandatory parameter 
+and is used without one as an error;
+
+(Mock C#:)
+
+class MyAttribute : Attribute {
+
+  public MyAttribute(string mandatoryParameter) {}
+
+}
+
+class TestIt {
+  
+  [My("Mandatoryparameter")]
+  void ThisShouldCompile() {}
+
+  [My]
+  void ThisShouldNot() {} // It does, however.
+
+}
+
+Steps to reproduce the problem:
+1. Write an attribute with a constructor that expects a mandatory 
+parameter.
+2. Write code that uses the attribute without supplying a parameter.
+3. Compile.
+
+Actual Results:
+
+Code compiles when it should not.
+
+Expected Results:
+
+Code should not compile with the error message that a mandatory parameter 
+to the attribute is missing.
+
+How often does this happen? 
+
+It reproduces 100% of the time with 0.25.
+
+Additional Information:
+
+The code has been tested with csc to confirm that mcs behaves incorrectly. 
+Sorry, but I do not have the MS error code readily at hand.