示例#1
0
        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++;
            }
        }
示例#2
0
文件: RType.cs 项目: dubik/csharprpp
 public RppMethodInfo DefineConstructor(RMethodAttributes attributes, RppParameterInfo[] parameterTypes)
 {
     RppMethodInfo constructor = new RppMethodInfo("ctor", this, attributes, UnitTy, parameterTypes);
     _constructors.Add(constructor);
     return constructor;
 }
示例#3
0
        private RppParameterInfo InflateParameter(RppParameterInfo parameter)
        {
            if (parameter.Type.IsGenericParameter || parameter.Type.IsGenericType)
            {
                var substitutedType = SubstitutedType(parameter.Type);
                return parameter.CloneWithNewType(substitutedType);
            }

            return parameter;
        }