[Mono-bugs] [Bug 640718] New: Mono 2.8 Preview 6: gmcs regression -- spurious CS0165 error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Sep 21 03:27:46 EDT 2010


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

https://bugzilla.novell.com/show_bug.cgi?id=640718#c0


           Summary: Mono 2.8 Preview 6: gmcs regression -- spurious CS0165
                    error
    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

Code that previously compiled with 2.6.7 and compiles with microsoft's csc is
failing to build with 2.8 preview 6. 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])

brian at brianmbp ~ $ cat y.cs       

public class Foo {
    static void Bar(System.Threading.ThreadStart ts) { }
    static void Baz(int yy) { }

    public static void Main(string[] args) {
        Bar(delegate {
            foreach (string x in new string[0]) {
                int yy;
                switch (x) {
                    case "x":  yy = 1;  break;
                    default:            continue;
                }
                Baz(yy);
            }
        });
    }
}

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

brian at brianmbp ~ $ gmcs y.cs
y.cs(13,21): error CS0165: Use of unassigned local variable `yy'
Compilation failed: 1 error(s), 0 warnings



Reproducible: Always

Steps to Reproduce:
See above.
Actual Results:  
Compilation fails with CS0165

Expected Results:  
Compilation succeeds. 

The code is valid and yy is used improperly. It looks like something in the
compiler's flow analysis stuff breaks within anonymous method blocks.

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