[Mono-bugs] [Bug 332909] New: MCS quietly ignores attributes with inaccessible constructor

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 11 07:51:00 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=332909

           Summary: MCS quietly ignores attributes with inaccessible
                    constructor
           Product: Mono: Compilers
           Version: 1.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: rharinath at novell.com
        ReportedBy: juraj at hotfeet.ch
         QAContact: mono-bugs at ximian.com
          Found By: ---


The following code compiles without error on Mono:

using System;
using System.Reflection;

namespace Test {
        public class SomeAttribute : Attribute {
                SomeAttribute() {}
        }

        [SomeAttribute]
        public class SomeClass {
                public int SomeProp { get { return 0; } }

                static void Main() {           
Console.WriteLine(typeof(SomeClass).GetCustomAttributes(typeof(SomeAttribute),
true).Length);
                }
        } 
}

The output is "0" as the SomeAttribute is not compiled into the .exe/.dll.

On MS.NET, csc stops with error CS0122.


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


More information about the mono-bugs mailing list