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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 29 23:51:28 EDT 2007


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

           Summary: Wrong method picked in generic resolution => IronRuby
                    failure
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: msafar at novell.com
        ReportedBy: miguel at novell.com
         QAContact: mono-bugs at ximian.com
                CC: rharinath at novell.com
          Found By: ---


The following makes IronRuby fail to work when compiled with gmcs:

The following program should display:
GetMethodInfos X.Boolean f1(Int32, Int32)

Instead it displays:
GetMethodInfos X.Boolean f1(Int32, System.Object)


Program:

using System;
using System.Reflection;

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

        static void Main ()
        {
                Delegate [] d = new Delegate [] {
                        new Function<int, int, bool> (f1),
                };

                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 f1 (int a, int b)
        {
                return false;
        }

        static bool f1 (int a, object b)
        {
                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