Bug 312690 (MONO47448) - MCS fails to identify and report missing mandatory parameters to attributes
Summary: MCS fails to identify and report missing mandatory parameters to attributes
Status: RESOLVED MOVED
Alias: MONO47448
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-10 03:25 UTC by Lars Thomas Denstad
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:14:03 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"