internal static MethodBase InternalGetCurrentMethod(ref StackCrawlMark stackMark)
{
RuntimeMethodHandle method = RuntimeMethodHandle.GetCurrentMethod(ref stackMark);
if (method.IsNullHandle())
return null;
// If C<Foo>.m<Bar> was called, GetCurrentMethod returns C<object>.m<object>. We cannot
// get know that the instantiation used Foo or Bar at that point. So the next best thing
// is to return C<T>.m<P> and that's what GetTypicalMethodDefinition will do for us.
method = method.GetTypicalMethodDefinition();
return RuntimeType.GetMethodBase(method);
}
#endregion