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

https://bugzilla.novell.com/show_bug.cgi?id=651305#c1


Sebastien Pouliot <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
           Severity|Normal                      |Enhancement

--- Comment #1 from Sebastien Pouliot <[email protected]> 2010-11-11 02:10:19 
UTC ---
Do you mean it's useless because we know 'o' is null ? (see a) so the condition
could be optimized away (e.g. automatically by a compiler or manually by a
gendarme defect)

Or (my guess ;-) because 'o as string' will return null anyway if 'o' is null ?
(see b)


(a) 
using System;
class Program {
    static void Main ()
    {
        Console.WriteLine (AsString (null));
    }

    static string AsString (object o)
    {
        string a = o == null ? null : o as string;
        return a;
    }
}

(b)
using System;
class Program {
    static void Main ()
    {
        object o = null;
        string a = o == null ? null : o as string;
        Console.WriteLine (a);
    }
}

-- 
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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to