public static void DefineParameters(MethodBuilder method, RppParameterInfo[] rppParams) { Type[] paramTypes = ParametersTypes(rppParams); method.SetParameters(paramTypes); int index = 1; foreach (var param in rppParams) { param.Index = index; // In static args should start from 1 method.DefineParameter(index, ParameterAttributes.None, param.Name); index++; } }
public RppMethodInfo DefineConstructor(RMethodAttributes attributes, RppParameterInfo[] parameterTypes) { RppMethodInfo constructor = new RppMethodInfo("ctor", this, attributes, UnitTy, parameterTypes); _constructors.Add(constructor); return constructor; }
private RppParameterInfo InflateParameter(RppParameterInfo parameter) { if (parameter.Type.IsGenericParameter || parameter.Type.IsGenericType) { var substitutedType = SubstitutedType(parameter.Type); return parameter.CloneWithNewType(substitutedType); } return parameter; }