[Mono-bugs] [Bug 354757] IsGenericMethodDefinition returns false for open generic method

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 23 21:03:33 EST 2008


User rkumpera at novell.com added comment

--- Comment #9 from Rodrigo Kumpera <rkumpera at novell.com>  2008-01-23 19:03:32 MST ---
I implemented a hack similar to is_tb_open. It is the way to fix the issue
under the current setup of SRE.

The patch fixes gtest-261, but gtest-045 still breaking. Some constraints
expected by gmcs might have been broken by the patch, still need to investigate

The patch makes the following code print True False, which is the expected

using System;
using System.Reflection;
using System.Reflection.Emit;

public class Entry
    public static void Main()
        AssemblyName name = new AssemblyName("I");
        AssemblyBuilder asmbuild =
        ModuleBuilder mod = asmbuild.DefineDynamicModule("I.exe");

        TypeBuilder G = mod.DefineType("G", TypeAttributes.Public);
        Type T = G.DefineGenericParameters("T")[0];
        Type GObj = G.MakeGenericType (new Type[] { typeof(object) });

        MethodBuilder M = G.DefineMethod("M", MethodAttributes.Public);
        Type S = M.DefineGenericParameters("S")[0];

        MethodInfo GObjM = TypeBuilder.GetMethod(GObj, M);
        Console.WriteLine (GObjM.IsGenericMethodDefinition);

                GObjM = GObjM.MakeGenericMethod (S);
                Console.WriteLine (GObjM.IsGenericMethodDefinition);

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