[Mono-bugs] [Bug 359733] Generic Extension methods with constraints on the generic type don' t compile

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Feb 10 10:50:53 EST 2008


User atsushi at ximian.com added comment

--- Comment #5 from Atsushi Enomoto <atsushi at ximian.com>  2008-02-10 08:50:53 MST ---
I've cooked a similar test case, which actually compiled fine. So it does not
happen when the extension type is in the same assembly (i.e. likely reference
resolution issue).

using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Linq;

public class Test
        public static void Main ()
                XDocument doc = XDocument.Parse
                // replace it with Remove<XNode>() and it will fail.
                doc.Root.Nodes ().Hooray<XNode> ();

public static class MyExtensions
        public static void Hooray<T> (this IEnumerable<T> source) where T :
                foreach (T item in source)
                        item.Remove ();

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list