[Mono-bugs] [Bug 359604] New: gmcs have trouble resolving proper generic extension methods

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 7 10:48:08 EST 2008


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


           Summary: gmcs have trouble resolving proper generic extension
                    methods
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jbevain at novell.com
         QAContact: mono-bugs at lists.ximian.com
                CC: rodrigobamboo at gmail.com
          Found By: ---


Repro:

--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

public interface IFoo<T> : IEnumerable<T> {}

public static class FooRocks {

        public static IFoo<T> Where<T> (this IFoo<T> foo, Expression<Func<T,
bool>> expression)
        {
                return Process (foo, data => { return data.Where
(expression.Compile ()); } );
        }

        public static IFoo<T> Process<T> (IFoo<T> foo,
                Func<IEnumerable<T>, IEnumerable<T>> processor)
        {
                processor (foo);

                return foo;
        }
}

class Repro {

        static void Main ()
        {
        }
}
--

gmcs try to pick up the Where extension method which takes a Func<T, int,
bool>, instead of the one which takes a Func<T, bool>.


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


More information about the mono-bugs mailing list