https://bugzilla.novell.com/show_bug.cgi?id=394347

User [EMAIL PROTECTED] added comment
https://bugzilla.novell.com/show_bug.cgi?id=394347#c5


Dustin Breese <[EMAIL PROTECTED]> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |[EMAIL 
PROTECTED]




--- Comment #5 from Dustin Breese <[EMAIL PROTECTED]>  2008-09-18 14:43:44 MDT 
---
The workaround seems to be that you can cast your anonymous delegate as
follows:

class MainClass
    {
        delegate string SomeDelegate();

        public static void Main(string[] args)
        {
            Dictionary<string, SomeDelegate> dictionary = new
Dictionary<string, SomeDelegate> ();
                        dictionary ["TEST"] = (SomeDelegate)delegate { return
"In the delegate!"; };

            // See if the delegate is invoked
            SomeDelegate someDelegate;
            bool result = dictionary.TryGetValue ("TEST", out someDelegate);
            Console.WriteLine("Was it found? " + result);
            Console.WriteLine("Result = " + someDelegate());
        }

This will also fix bug https://bugzilla.novell.com/show_bug.cgi?id=369538
causing issues in MonoDevelop.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to