[Mono-bugs] [Bug 34161][Maj] Changed - implicit conversion with enums values issue
17 Nov 2002 17:16:00 -0000
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 email@example.com.
--- shadow/34161 Sun Nov 17 09:06:02 2002
+++ shadow/34161.tmp.10953 Sun Nov 17 12:16:00 2002
@@ -2,14 +2,14 @@
+Severity: 040 One week
@@ -35,7 +35,22 @@
I assume this is the
System.Security.Cryptography/MiniParser.cs(256) error CS0029: Cannot convert implicitly from `int' to `System.UInt16'
Thanks for the testcase, I was unable to trigger the problem ....
+------- Additional Comments From firstname.lastname@example.org 2002-11-17 12:16 -------
+Ok, this is a bit difficult. Already posted a workaround to mono-hackers.
+The problem is the following:
+When doing `(ushort)a << 4', the left-hand side is casted to `int' because the left-shift operator operates on ints.
+This means that the expression has a type of `int'.
+When assigning this expression, Assign.DoResolve doesn't know that the expression was initially of type ushort and that the implicit
+conversion to ushort is allowed.
+As a workaround, explicitly cast the whole expression to short. Since this problem requires some thinking and there's a simple
+workaround, setting priority to major.