[Mono-bugs] [Bug 624870] New: gmcs looks at private members instead of public propertes in annotation attribute matching

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 22 17:26:55 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=624870

http://bugzilla.novell.com/show_bug.cgi?id=624870#c0


           Summary: gmcs looks at private members instead of public
                    propertes in annotation attribute matching
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.6.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dawid.weiss at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User
           Blocker: No


Description of Problem:

Attribute classes generated by ikvm cross-compiler from Java have the following
structure (decompilation):

   .method private newslot virtual final instance string attr() cil managed
   {
      // ...
   }

   .property instance string prefix
   {
       .get instance string ExampleAttribute::get_attr()
       .set instance void   ExampleAttribute::set_attr(string)
   }

given this, the following use case of attribute Example on a C# class causes
gmcs to fail:

 [ExampleAttribute(attr = "blah")]
 public class MyClazz {}

The error is:

error CS0122: `ExampleAttribute.attr()' is inaccessible due to its protection
level

The same class compiles fine with csc.


How often does this happen? 

Always

Additional Information:

Private class members (methods) should not be considered for matching, or at
least should be prioritized by scope producing a warning?

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list