[Mono-bugs] [Bug 78106][Wis] New - anonymouse method in init field

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Apr 14 07:52:28 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 redforks at gmail.com.

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

--- shadow/78106	2006-04-14 07:52:28.000000000 -0400
+++ shadow/78106.tmp.13052	2006-04-14 07:52:28.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 78106
+Product: Mono: Compilers
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: redforks at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: anonymouse method in init field
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+When compile fowllowing code, gmcs with error: 
+error CS1706: Anonymous methods are not allowed in attribute declaration
+
+
+using System;
+using System.Collections;
+
+delegate void AFunc(string s);
+class NeedAFunc
+{
+  public NeedAFunc(AFunc func) { }
+}
+
+public class IterTest
+{
+  NeedAFunc mNeedAFunc = new NeedAFunc(delegate(string s) // error here.
+  {
+    Console.WriteLine(s);
+  });
+
+  public static void Main()
+  {
+    return;
+  }
+}


More information about the mono-bugs mailing list