Bugzilla – Bug 312690
MCS fails to identify and report missing mandatory parameters to attributes
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by larsde@key2network.com 2003-08-09 20:25:45 MST ---- 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. ---- Additional Comments From ravi@ximian.com 2003-08-11 10:54:18 MST ---- This has been fixed in the latest CVS version - please try it with that. *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO43632 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"