[Mono-bugs] [Bug 74529][Nor] New - mcs fails to detect unassigned variable

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 8 Apr 2005 15:47:08 -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=74529

--- shadow/74529	2005-04-08 15:47:08.000000000 -0400
+++ shadow/74529.tmp.3177	2005-04-08 15:47:08.000000000 -0400
@@ -0,0 +1,42 @@
+Bug#: 74529
+Product: Mono: Compilers
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs fails to detect unassigned variable
+
+Apply the following patch to mcs/tools/mono-service/mono-service.cs
+---------------
+Index: mono-service.cs
+===================================================================
+--- mono-service.cs     (revision 42700)
++++ mono-service.cs     (working copy)
+@@ -175,7 +175,7 @@
+
+                // Start up the service.
+
+-               ServiceBase service = null;
++               ServiceBase service;
+
+                if (name != null){
+                        foreach (ServiceBase svc in services){
+---------------
+
+and compile with mcs.
+
+Actual results:
+It compiles.
+
+Expected results:
+mono-service.cs(191): error CS0165: Use of unassigned local variable 'service'