[Mono-bugs] [Bug 78290][Nor] New - CS0177 is not always reported when dealing with a try/catch

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu May 4 10:26:43 EDT 2006


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 jo.vermeulen at gmail.com.

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

--- shadow/78290	2006-05-04 10:26:43.000000000 -0400
+++ shadow/78290.tmp.17729	2006-05-04 10:26:43.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 78290
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Ubuntu Linux Dapper Drake Beta
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: jo.vermeulen at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0177 is not always reported when dealing with a try/catch
+
+Description of Problem:
+
+When compiling a piece of code which does not always assign an out
+variable, no error is given.
+
+Steps to reproduce the problem:
+1. Compile OutputParam.cs which I will upload in a minute (run "mcs
+OutputParam.cs")
+
+Actual Results:
+
+OutputParam.cs(21,2): warning CS0162: Unreachable code detected
+Compilation succeeded - 1 warning(s)
+
+Expected Results:
+
+(The errors are extrapolated from Visual Studio 2005's output, so the
+format might not be correct, line and column numbers are correct though)
+
+OutputParam.cs(18,6): error CS0177: The out parameter 'a' must be assigned
+to before control leaves the current method
+OutputParam.cs(19,26): error CS0177: The out parameter 'a' must be assigned
+to before control leaves the current method
+
+
+OutputParam.cs(21,2): warning CS0162: Unreachable code detected
+Compilation failed: 2 error(s), 1 warnings
+
+How often does this happen? 
+
+Always
+
+Additional Information:
+
+Please note that Visual Studio gives two errors about this, one at the
+return statement in the catch clause, and one at the return statement in
+the try clause.
+
+This might have been caused by resolving another bug (not sure though):
+
+http://bugzilla.ximian.com/show_bug.cgi?id=47095


More information about the mono-bugs mailing list