[Mono-bugs] [Bug 324996] [GMCS] CS0184 always reported using is operator on nullable

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Nov 9 17:55:08 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=324996#c3


Gert Driesen <gert.driesen at pandora.be> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
             Status|RESOLVED                                        |REOPENED
         Resolution|FIXED                                           |




--- Comment #3 from Gert Driesen <gert.driesen at pandora.be>  2007-11-09 15:55:07 MST ---
Marek, you're wrong about this. A nullable int is of course not always an int.

Try compiling and running the following code:

using System;

class Program
{
        static void Main ()
        {
                int? i = null;
                if (i is int) {
                        Console.WriteLine ((int) i + 3);
                }
        }
}

When compiled with gmcs, this results in an InvalidOperationException (Nullable
object must have a value), while it should not.


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