[Mono-bugs] [Bug 44120][Nor] New - mcs allows assigning an uninitialized var. to itself

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 3 Jun 2003 23:57:49 -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 gonzalo@ximian.com.

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

--- shadow/44120	Tue Jun  3 23:57:49 2003
+++ shadow/44120.tmp.25803	Tue Jun  3 23:57:49 2003
@@ -0,0 +1,37 @@
+Bug#: 44120
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs allows assigning an uninitialized var. to itself
+
+Compile this program into a library:
+----
+using System;
+
+class C
+{
+	static void Method (object o)
+	{
+		C c = (C) c;
+	}
+}
+----
+
+Actual results:
+Compilation succeded.
+(and a NullRef at runtime)
+
+Expected results:
+decl.cs(7,13): error CS0165: Use of unassigned local variable 'c'.