[Mono-bugs] [Bug 77119][Nor] New - Cannot create anonymous methods with "out" keyword.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Dec 29 11:11:33 EST 2005


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 felipe.lessa at gmail.com.

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

--- shadow/77119	2005-12-29 11:11:33.000000000 -0500
+++ shadow/77119.tmp.19835	2005-12-29 11:11:33.000000000 -0500
@@ -0,0 +1,51 @@
+Bug#: 77119
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: Debian Unstable (packages version 1.1.12.1-1)
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: felipe.lessa at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Cannot create anonymous methods with "out" keyword.
+
+Description of Problem:
+If you try to create an anonymous method for a delegate that have an out
+keyword, it just doesn't comiple.
+
+Steps to reproduce the problem:
+For example, try this test case (compile with a simple "mcs bug.cs"):
+-------------------
+public delegate void TestDelegate (out int a);
+
+public static class TestClass {
+        public static void Main() {
+                TestDelegate wontCompile = delegate (out int a) {
+                        a = 0;
+                };
+        }
+}
+------------------
+
+Actual Results:
+$ mcs bug.cs
+bug.cs(5,44): error CS1677: Parameter `1' should not be declared with the
+`out' keyword
+bug.cs(5,44): error CS1661: Anonymous method could not be converted to
+delegate `TestDelegate' since there is a parameter mismatch
+Compilation failed: 2 error(s), 0 warnings
+
+
+Expected Results:
+$ mcs bug.cs
+$ # File was compiled correctly
+
+How often does this happen? 
+Everytime, with mcs and gmcs.


More information about the mono-bugs mailing list