[Mono-bugs] [Bug 36054][Wis] New - cs0186: Casting null invalid.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
23 Dec 2002 13:06:12 -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 raciel@es.gnu.org.

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

--- shadow/36054	Mon Dec 23 08:06:12 2002
+++ shadow/36054.tmp.19104	Mon Dec 23 08:06:12 2002
@@ -0,0 +1,38 @@
+Bug#: 36054
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: raciel@es.gnu.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: cs0186: Casting null invalid.
+
+I have made the following test sample 
+
+// cs0186.cs: Can't cast null.
+// Line: 8
+
+public class A
+{
+	static void Main()
+	{
+		(int) null;
+	}
+}
+
+and the compiler dont say nothing about that error, it tells:
+
+raciel@voyager:~/cvs/mono/mcs/errors$ mcs cs0186.cs 
+syntax error, expecting ASSIGN OP_MULT_ASSIGN OP_DIV_ASSIGN OP_MOD_ASSIGN
+OP_ADD_ASSIGN OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN OP_SHIFT_RIGHT_ASSIGN
+OP_AND_ASSIGN OP_XOR_ASSIGN OP_OR_ASSIGN
+cs0186.cs(5) error CS1002: Expecting `;'