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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78786 --- shadow/78786 2006-07-07 06:13:34.000000000 -0400 +++ shadow/78786.tmp.7306 2006-07-07 06:18:22.000000000 -0400 @@ -2,13 +2,13 @@ Product: Mono: Compilers Version: 1.1 OS: GNU/Linux [Other] OS Details: Fedora Core 2 Status: NEW Resolution: -Severity: +Severity: Unknown Priority: Normal Component: C# AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] TargetMilestone: --- @@ -68,6 +68,30 @@ Additional Information: The code works as intended on .NET 2.0 (Windows). The problem is found in 1.1.15 but still remains in 1.1.16. Interessetingly the compiler does now die, if the delegate is stored into a local variable (and not into a dictionary as in the sample above). + +------- Additional Comments From [EMAIL PROTECTED] 2006-07-07 06:18 ------- +The following code works as intended: +using System.Collections.Generic; + +public class Test { + public delegate int TestDel (int a); + + public static void Main (string[] args) { + Dictionary<string, TestDel> dict = new +Dictionary<string, TestDel> (); + + TestDel testDel = delegate (int b) { + return b; + }; + + dict["a"] = testDel; + + System.Console.WriteLine (dict["a"] (2)); + } +} + +So temporarily storing the delegate into a local variable is a work +around. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
