[Mono-bugs] [Bug 74885][Nor] Changed - implicit string conversions
not considered when evaluating == operator
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Jul 30 14:16:12 EDT 2005
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 rharinath at novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74885
--- shadow/74885 2005-07-15 16:59:03.000000000 -0400
+++ shadow/74885.tmp.25800 2005-07-30 14:16:12.000000000 -0400
@@ -10,13 +10,13 @@
Component: C#
AssignedTo: rharinath at novell.com
ReportedBy: robertj at gmx.net
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
URL:
-Summary: ECMA 14.9.6 violation
+Summary: implicit string conversions not considered when evaluating == operator
ECMA 14.9.6 states that the predefined operator "=="
must fail on value types. Both mcs and gmcs (from SVN)
violate the rule when a user-defined implicit convertion
for a numeric type is implemented by a value type:
@@ -73,6 +73,26 @@
S a = new S(1);
S b = new S(1);
// should fail with error CS0019
Console.WriteLine(a == b);
}
}
+
+------- Additional Comments From rharinath at novell.com 2005-07-30 14:16 -------
+Section 14.9.6 deals with the reference equality operator, and any
+comments in that section about value types is not normative -- the
+text says that it's an implication of the rule, but given the way it's
+worded, I feel that it's incomplete and only informative about value
+types.
+
+The relevant section is 14.2.4 (Binary operator overload resolution) says:
+
+ If the set of candidate user-defined operators is not empty, then
+ this becomes the set of candidate operators for the operation.
+ Otherwise, the predefined binary operator op implementations become
+ the set of candidate operators for the operation.
+
+Normal overload-resolution takes over after that, with implicit
+conversions, and the "better conversion" and "better function" decisions.
+
+So, IMHO, the bug would be that mcs/gmcs fails to honour implicit
+string conversions.
More information about the mono-bugs
mailing list