[Mono-bugs] [Bug 640722] New: Mono 2.8 Preview 6: gmcs regression -- spurious CS0108 warning

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 21 03:37:40 EDT 2010



           Summary: Mono 2.8 Preview 6: gmcs regression -- spurious CS0108
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.8.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: brian at sooloos.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.25 Safari/534.3

This warning is not produced by 2.6.7 nor microsoft's csc. I am testing with
the binary x86 osx
distribution of the compiler available here:
http://mono.ximian.com/monobuild/preview/download-preview/. The top of the page
indicated the following version at the time of the download: Mono 2.8 Downloads
(Preview 6 [58f029f])

The warning appears to be incorrect (explained below).

brian at brianmbp ~ $ cat z.cs   

public abstract class Base
    public delegate void Action<U>(U val);

public class Derived<U> : Base
    internal Action<U> Action;

public class Foo {
    public static void Main(string[] args) { }

brian at brianmbp ~ $ gmcs --version
Mono C# compiler version

brian at brianmbp ~ $ gmcs z.cs
z.cs(8,24): warning CS0108: `Derived<U>.Action' hides inherited member
`Base.Action<U>'. Use the new keyword if hiding was intended
z.cs(3,26): (Location of the symbol related to previous warning)
Compilation succeeded - 1 warning(s)

Reproducible: Always

Steps to Reproduce:
1. See above
Actual Results:  
Warning is emitted

Expected Results:  
Compilation succeeds with no warnings.

At first glance this warning appears to be warranted, but upon further
inspection, I'm almost positive that it's a bug. 

The "Action" field on Derived cannot shadow the nested "Action<U>" type on
Derived because the nested type requires a type parameter. Every reference to
Action/Action<> will is unambiguous depending on 
the presence or absence of a type parameter, thus no shadowing is occurring

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