Bug 319600 (MONO76780) - [GMCS] IsGenericMethodDefinition always false for InternalCalls
Summary: [GMCS] IsGenericMethodDefinition always false for InternalCalls
Status: RESOLVED FIXED
Alias: MONO76780
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Blocker
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-21 14:17 UTC by Michal Moskal
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:38:52 UTC


---- Reported by malekith@pld-linux.org 2005-11-21 07:17:29 MST ----

Description of Problem:

The mono S.R.E. API doesn't account for InternalCalls and PInvoke methods
that are generic. They are always treated as non-generic, but it seems
possible to have at least generic internal calls, like the ones introduced
here:
http://lists.ximian.com/pipermail/mono-patches/2005-November/067172.html

This makes the Nemerle compiler choke on these.

The following program demonstrates the problem:

#v+
using System;
using System.Reflection;

class C {
  public static void Main ()
  {
    MethodInfo ex = null;

    foreach (MethodInfo m in typeof(System.Threading.Interlocked).GetMethods())
                if (m.Name == "Exchange" && m.IsGenericMethodDefinition)
                        ex = m;

    Console.WriteLine ("{0} {1} {2}", ex, ex.IsGenericMethodDefinition,
ex.GetType());
        foreach (Type t in ex.GetGenericArguments ())
      Console.WriteLine ("  {0}", t);
  }
}
#v-

Actual Results:
null ref exception

Expected Results:
list of type parameters

How often does this happen? 
always

Additional Information:
mono svn trunk



---- Additional Comments From malekith@pld-linux.org 2005-11-21 10:56:56 MST ----

Martin seem to have just fixed that in r53305.

I'm not sure I'm allowed to close it :)



---- Additional Comments From lupus@ximian.com 2005-11-22 04:58:23 MST ----

Please don't close this bug: Martin's fix in svn is broken.



---- Additional Comments From martin@ximian.com 2005-12-07 07:35:52 MST ----

Closing the bug.


Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>amd64 pld linux</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".