[Mono-bugs] [Bug 74041][Wis] New - Cannot declare and use local variables inside unreachable code
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 23 Mar 2005 20:32:04 -0500 (EST)
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 rodrigobamboo@gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74041
--- shadow/74041 2005-03-23 20:32:04.000000000 -0500
+++ shadow/74041.tmp.3786 2005-03-23 20:32:04.000000000 -0500
@@ -0,0 +1,55 @@
+Bug#: 74041
+Product: Mono: Compilers
+Version: 1.0
+OS: SUSE 9.2
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: rodrigobamboo@gmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Cannot declare and use local variables inside unreachable code
+
+Steps to reproduce the problem:
+
+1. Compile the following application:
+
+public class Application
+{
+ public static void Main(string[] args)
+ {
+ if (true)
+ {
+ string thisWorks = "nice";
+ System.Console.WriteLine(thisWorks);
+ }
+ else
+ {
+ string thisDoesnt = "not so";
+ System.Console.WriteLine(thisDoesnt);
+ }
+ }
+}
+
+Actual Results:
+
+Main.cs(11) warning CS0162: Unreachable code detected
+Main.cs(13) error CS0165: Use of unassigned local variable `thisDoesnt'
+Build complete -- 1 errors, 1 warnings
+
+Expected Results:
+
+Main.cs(11) warning CS0162: Unreachable code detected
+Build complete -- 0 errors, 1 warnings
+
+
+How often does this happen?
+
+
+Additional Information: