[Mono-bugs] [Bug 685923] New: [Flow-analysis] Missing CS0165 on folded expressions

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 7 11:33:08 EDT 2011


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

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


           Summary: [Flow-analysis] Missing CS0165 on folded expressions
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: msafar at novell.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


class Program
{
    public static void Main()
    {
        int i1, i2, i3;

        // 'as' is not permitted in a constant expression.
        if (null as object == null)
            i1 = 1;

        // 'is' is not permitted in a constant expression.
        if (!(null is object))
            i2 = 1;

        int j4 = 0;
        if ((0 == (j4 & 0)) && (0 == (0 & j4)))
            i3 = 1;

        System.Console.WriteLine("{0}{1}{2}{3}{4}{5}", i1, i2, i3);
    }
}

No error with mono

NET

error CS0165: Use of unassigned local variable 'i1'
error CS0165: Use of unassigned local variable 'i2'
error CS0165: Use of unassigned local variable 'i3'

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