public MethodSpec MakeGenericMethod(IMemberContext context, params TypeSpec[] targs)
{
if (targs == null)
throw new ArgumentNullException ();
// TODO MemberCache
// if (generic_intances != null && generic_intances.TryGetValue (targs, out ginstance))
// return ginstance;
//if (generic_intances == null)
// generic_intances = new Dictionary<TypeSpec[], Method> (TypeSpecArrayComparer.Default);
var inflator = new TypeParameterInflator (context, DeclaringType, GenericDefinition.TypeParameters, targs);
var inflated = (MethodSpec) MemberwiseClone ();
inflated.declaringType = inflator.TypeInstance;
inflated.returnType = inflator.Inflate (returnType);
inflated.parameters = parameters.Inflate (inflator);
inflated.targs = targs;
inflated.constraints = TypeParameterSpec.InflateConstraints (inflator, constraints ?? GenericDefinition.TypeParameters);
inflated.state |= StateFlags.PendingMakeMethod;
// if (inflated.parent == null)
// inflated.parent = parent;
//generic_intances.Add (targs, inflated);
return inflated;
}