[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
Mon Jul 23 13:17:36 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 miguel at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=80714
--- shadow/80714 2007-04-17 11:52:49.000000000 -0400
+++ shadow/80714.tmp.19262 2007-07-23 13:17:36.000000000 -0400
@@ -69,6 +69,19 @@
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.
+
+------- Additional Comments From miguel at ximian.com 2007-07-23 13:17 -------
+I think the explanation from Microsoft is incomplete, because in the
+particular case of:
+
+class Foo<T> where T: struct {
+
+ bool IsNull (T x) { return x == null; }
+}
+
+
+Is not permitted. If you remove "struct" then the above code
+compiles with CSC.
More information about the mono-bugs
mailing list