[Mono-bugs] [Bug 395287] New: C# compiler fails on following code sample ( automatic properties)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed May 28 20:29:26 EDT 2008


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


           Summary: C# compiler fails on following code sample (automatic
                    properties)
           Product: Mono: Compilers
           Version: unspecified
          Platform: i686
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jbenjos at fau.edu
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


-----
Code:
-----

namespace MonoTests
{
    public abstract class MainClass
    {
        public virtual string[] foo { get; set; }
        public abstract string[] bar { get; set; }

        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
    public class ChildClass : MainClass
    {
        public override string[] foo { get; set; }
        public override string[] bar { get; set; }
    }
}

--------------
Compiler error:
--------------

Compilation failed: 4 error(s), 0 warnings

/home/jonathan/MonoTests/MonoTests/Main.cs(22,42): error CS0507:
`MonoTests.ChildClass.foo.get': cannot change access modifiers when overriding
`internal' inherited member `MonoTests.MainClass.foo.get'
/home/jonathan/MonoTests/MonoTests/Main.cs(12,47): (Location of the symbol
related to previous error)
/home/jonathan/MonoTests/MonoTests/Main.cs(22,42): error CS0507:
`MonoTests.ChildClass.foo.set': cannot change access modifiers when overriding
`internal' inherited member `MonoTests.MainClass.foo.set'
/home/jonathan/MonoTests/MonoTests/Main.cs(12,52): (Location of the symbol
related to previous error)
/home/jonathan/MonoTests/MonoTests/Main.cs(23,42): error CS0507:
`MonoTests.ChildClass.bar.get': cannot change access modifiers when overriding
`internal' inherited member `MonoTests.MainClass.bar.get'
/home/jonathan/MonoTests/MonoTests/Main.cs(13,48): (Location of the symbol
related to previous error)
/home/jonathan/MonoTests/MonoTests/Main.cs(23,42): error CS0507:
`MonoTests.ChildClass.bar.set': cannot change access modifiers when overriding
`internal' inheriBuild complete -- 4 errors, 0 warningsted member
`MonoTests.MainClass.bar.set'
/home/jonathan/MonoTests/MonoTests/Main.cs(13,53): (Location of the symbol
related to previous error)

------
Notes:
------

* Compiles without errors or warnings on an unmodified copy of Visual Studio
2008 Professional.
* Compiles successfully on Mono without automatic properties (eg: if you do a
standard simple get/set property instead which has the same behavior as the
automatic property.)


-- 
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