[Mono-bugs] [Bug 523683] GMCS fails to perform overload resolution for delegates with generic arguments in certain cases

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jul 22 18:18:07 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=523683

User tom.philpot at logos.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=523683#c1





--- Comment #1 from Thomas Philpot <tom.philpot at logos.com>  2009-07-22 16:18:06 MDT ---
Here is another test case which does not work under gmcs but does in Mono
(tested against r138425):


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Test
{
    public static class Bar
    {
        public static int Baz<I, K>(IList<I> list, K k, Func<I, K, int> fnC,
out int nInt)
        {
            Console.WriteLine("I is {0}", typeof(I).Name);
            Console.WriteLine("K is {0}", typeof(K).Name);
            nInt = 0;
            return 0;
        }
    }

    public class CompilerTest
    {
        public delegate int Foo(IList<string> list, int nK, Func<string, int,
int> fnC, out int nInt);

        public void DoesNotWork()
        {
            DoFoo(Bar.Baz);
        }

//        public void DoesWork()
//        {
//            DoFoo((IList<string> list, int n, Func<string, int, int> fnC, out
int nInt) => Bar.Baz(list, n, fnC, out nInt));
//        }

        public static void DoFoo(Foo fnFoo)
        {
            int nInt;
            List<string> list = new List<string>();
            fnFoo(list, 1, SomeFunc, out nInt);
        }

        static int SomeFunc(string s, int nInt)
        {
            return 3;
        }
    }
}

-- 
Configure bugmail: http://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