[Mono-bugs] [Bug 80714][Min] Changed - [GMCS] operator == on struct and null causes error

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Apr 17 11:52:49 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jonpryor at vt.edu.


--- shadow/80714	2007-02-14 15:18:51.000000000 -0500
+++ shadow/80714.tmp.28898	2007-04-17 11:52:49.000000000 -0400
@@ -53,6 +53,22 @@
 I've reported this issue to MS using the connect web site:
 We'll see what MS responds on this.
+------- Additional Comments From jonpryor at vt.edu  2007-04-17 11:52 -------
+Microsoft's Response:
+The difference between the 1.1 compiler and the 2.0 compiler here is
+actually due to a change in the spec which makes the code you provided
+legal. This is related to the new C#2.0 feature "Nullable value types".
+Any operator between struct types, including ==, can now be 'lifted'
+to apply to the nullable version of the types. In your case, the ==
+operator from a pair of As to bool can be lifted to an operator from a
+pair of "A?"s to bool. The left hand argument is implicitly converted
+from A to A? and the right hand "null" is convertible to A? be
+default. The specific operation in your code will always return
+"false" though.

More information about the mono-bugs mailing list