[Mono-bugs] [Bug 336258] [Flow-analysis] of switch statement inside anonymous method is broken

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 22 05:17:14 EST 2008


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

User rook at roo.k.pl added comment
https://bugzilla.novell.com/show_bug.cgi?id=336258#c3


Michał Ziemski <rook at roo.k.pl> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |rook at roo.k.pl




--- Comment #3 from Michał Ziemski <rook at roo.k.pl>  2008-02-22 03:17:13 MST ---
Another test case to illustrate that the issue affects also "asigned" status of
a variable.

The code:
public static class Foo
{
    delegate void Simple();

    static void Bar(Simple s)
    {
        s();
    }

    public static void Main(string[] args)
    {
        Bar(delegate() {

          int i, j = 1;
          switch(j)
          {
              case 1: i = 1; break;
              default: i = 2; break;
          }
          System.Console.WriteLine("a" + i);
        });
    }
}

Yields (Mono 1.9 preview 3 GMCS):
bb.cs(19,42): error CS0165: Use of unassigned local variable `i'
rather than clean compile.


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