[Mono-bugs] [Bug 78115][Nor] New - gmcs cannot init delegate fields with assignment

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Apr 14 18:20:37 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 bcs26 at cornell.edu.

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

--- shadow/78115	2006-04-14 18:20:37.000000000 -0400
+++ shadow/78115.tmp.25712	2006-04-14 18:20:37.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 78115
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: bcs26 at cornell.edu               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs cannot init delegate fields with assignment
+
+The following program, attached (DelegateInit.cs), does not compile using gmcs:
+
+"
+using System;
+
+public class DelegateInit {
+    public delegate void FooDelegate();
+
+    public static readonly FooDelegate _print =
+        delegate() {
+            Console.WriteLine("delegate!");
+        };
+
+    public static void Main(string[] args) {
+        _print();
+    }
+}
+"
+
+Compilation fails with the following error:
+
+"
+DelegateInit.cs(7,9): error CS1706: Anonymous methods are not allowed in
+attribute declaration
+Compilation failed: 1 error(s), 0 warnings
+"
+
+As far as I can tell, compilation should succeed, and the program should
+print "delegate!". The irrelevant error message (the program contains no
+attribute declarations) suggests a compiler bug.
+
+This behavior is observed under mono 1.1.13.1 and 1.1.13.2, both amd64 and
+x86, using Gentoo Linux.


More information about the mono-bugs mailing list