[Mono-bugs] [Bug 56774][Nor] Changed - int -> byte better conversion than int -> short

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 30 May 2004 23:20:05 -0400 (EDT)


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 bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=56774

--- shadow/56774	2004-05-30 23:16:18.000000000 -0400
+++ shadow/56774.tmp.9323	2004-05-30 23:20:05.000000000 -0400
@@ -74,6 +74,30 @@
 	static int X (short x) {
 		return 1;
 	}
 }
 
 Note this is *NOT* a binder issue. We are not using that code here.
+
+------- Additional Comments From bmaurer@users.sf.net  2004-05-30 23:20 -------
+Given an implicit conversion C1 that converts from a type S to a type
+T1, and an implicit conversion C2 that converts from a type S to a
+type T2, the better conversion of the two conversions is determined as
+follows:
+...
+If an implicit conversion from T1 to T2 exists, and no implicit
+conversion from T2 to T1 exists, C1 is the better conversion.
+
+If an implicit conversion from T2 to T1 exists, and no implicit
+conversion from T1 to T2 exists, C2 is the better conversion. 
+
+
+The implicit numeric conversions are:
+...
+
+ From byte to short, ushort, int, uint, long, ulong, float, double, or
+decimal
+ From short to int, long, float, double, or decimal.
+
+a imp. conv. from byte -> short exists, but not short -> byte.
+Therefore, by the `Better Conversion' function, the `byte' method is
+better.