Bugzilla – Bug 321065
[GMCS] gmcs generates wrong code for comparing nullable types
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by vargaz@gmail.com 2006-05-07 12:19:17 MST ---- Currently, gmcs creates code which calls the op_Equality and op_Inequality operators defined in the Nullable class, however, these methods no longer exist in in net 2.0 RTM, so gmcs compiled programs which use these methods can't be run on the MS runtime. Instead of these methods, it should generate code to call the HasValue (when comparing to null), or the GetValueOfDefault methods. Testcase: <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< using System; class M { static void f (int? x, int? y) { bool isnull = x == null; bool eq = x == y; } static void Main () { f (1, 1); f (null, null); } } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ---- Additional Comments From rharinath@novell.com 2006-05-25 15:25:46 MST ---- Hmm, some bug in bugzilla. This is RESOLVED FIXED. Should be fixed in SVN r61104. Unknown operating system unknown. Setting to default OS "Other".