[Mono-bugs] [Bug 379537] New: [GMCS] CS0649 should not be reported for fields assigned to using named parameters in CAs

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Apr 13 11:16:53 EDT 2008


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


           Summary: [GMCS] CS0649 should not be reported for fields assigned
                    to using named parameters in CAs
           Product: Mono: Compilers
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


gmcs should not report CS0649 for fields of Attribute classes that are assigned
to using named parameters.

MS fixed this in csc 2.x.

To reproduce, compile the following code:

using System;

[Foo (Product="Mono", Country="US")]
class Program
{
        static void Main ()
        {
        }
}

class FooAttribute : Attribute
{
        public string Product;
        public string Company;
        private string country;
        private string town;

        public FooAttribute ()
        {
        }

        public string Country {
                get { return country; }
                set { country = value; }
        }

        public string Town {
                get { return town; }
                set { town = value; }
        }
}

Expected result:

test.cs(14,16): error CS0649: Warning as Error: Field 'FooAttribute.Company' is
never assigned to, and will always have its default value null

Actual result:

test.cs(13,23): error CS0649: Field `FooAttribute.Product' is never assigned
to, and will always have its default value `null'
test.cs(14,23): error CS0649: Field `FooAttribute.Company' is never assigned
to, and will always have its default value `null'


-- 
Configure bugmail: https://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