Bug 321065 (MONO78324) - [GMCS] gmcs generates wrong code for comparing nullable types
Summary: [GMCS] gmcs generates wrong code for comparing nullable types
Status: RESOLVED FIXED
Alias: MONO78324
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-07 19:19 UTC by Forgotten User vxPDddArjq
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:58:05 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".