This question is continue of How to distinguish MethodBase in generics
In brief: I need to distinguish in Dictionary same generic method when it is called for different generic types substitution.
static Dictionary<MethodBase, string> cache = new Dictionary<MethodBase, string>();
static void Method1<T>(T g)
{
MethodBase m1 = MethodBase.GetCurrentMethod();
cache[m1] = "m1:" + typeof(T);
}
So, I've overrided IEqualityComparer, to compare MethodBase argument by argument. And during debuging I was wondered that there is no way to detect real type of argument of generic method, neither GetGenericArguments nor GetParameters don't provide real type of calling. Am I right? If so I cannot see another way than compare by first line Environment.StackTrace - because only this method explores type of argument.