[Mono-bugs] [Bug 337712] Wrong method picked in generic resolution => IronRuby failure

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Nov 4 23:30:04 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=337712#c2


Miguel de Icaza <miguel at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
             Status|RESOLVED                                        |REOPENED
         Resolution|FIXED                                           |




--- Comment #2 from Miguel de Icaza <miguel at novell.com>  2007-11-04 21:30:03 MST ---
Ah, bugzilla finally came up again.

This is a different variant from the old bug, I already emailed Marek
privately, but am adding this to Bugzilla as well;   Am reopening the bug
because it is on the same spirit (and it also came from IronRuby for the same
kind of tests).

In this instance, the variation is that it never picks the most-specific
version of the method (bool f2(IList, IList)).   This program should display
the two different methods.

using System.Collections;
using System;
using System.Reflection;

class X {
        public delegate R Function<T1, T2, R>(T1 arg1, T2 arg2);

        static void Main ()
        {
                Delegate [] e = new Delegate [] {
                        new Function<IList,IList,bool> (f2),
                        new Function<IList,object,bool> (f2)
                };
                Console.WriteLine ("The following should display two different
instantiations:");
                Dump (e);
        }

        static void Dump (Delegate [] d)
        {
                MethodInfo[] result = new MethodInfo[d.Length];
                for (int i = 0; i < d.Length; i++) {
                        result[i] = d[i].Method;
                        Console.WriteLine ("GetMethodInfos {0}.{1}", result
[i].DeclaringType, result [i]);
                }
        }

        static bool f2 (IList self, IList other) {return false;}
        static bool f2 (IList self, object other) {return false;}
}


-- 
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