[Mono-bugs] [Bug 420181] New: variable considered unassigned when set in nested default blocks of switch

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 25 17:13:20 EDT 2008


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


           Summary: variable considered unassigned when set in nested
                    default blocks of switch
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: wasabi at larvalstage.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


string foo;

switch (bar)
{
  case 1:
    foo = "123";
    break
  default:
    switch (bar2)
    {
      case 1:
        foo = "123";
      default:
        foo = "456";
    }
}

return foo;




The previous results in a CS0165 on the return line. 'foo' should always be
considered initialized since it is initialized in the default block in all
cases.


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