Example #1
0
        public int GetGenericParamNum(string id)
        {
            if (gen_params == null)
            {
                return(-1);
            }

            return(gen_params.GetGenericParamNum(id));
        }
Example #2
0
        public override void Resolve(GenericParameters type_gen_params, GenericParameters method_gen_params)
        {
            if (param.Name == "")
            {
                /* Name wasn't specified */
                return;
            }

            if (param.Type == PEAPI.GenParamType.MVar && method_gen_params != null)
            {
                param.Index = method_gen_params.GetGenericParamNum(param.Name);
            }
            else if (type_gen_params != null)
            {
                param.Index = type_gen_params.GetGenericParamNum(param.Name);
            }

            if (param.Index < 0)
            {
                Report.Error(String.Format("Invalid {0}type parameter '{1}'",
                                           (param.Type == PEAPI.GenParamType.MVar ? "method " : ""),
                                           param.Name));
            }
        }
Example #3
0
                public override void Resolve (GenericParameters type_gen_params, GenericParameters method_gen_params)
                {
                        if (param.Name == "") {
                                /* Name wasn't specified */
                                return;
                        }

                        if (param.Type == PEAPI.GenParamType.MVar && method_gen_params != null)
                                param.Index = method_gen_params.GetGenericParamNum (param.Name); 
                        else if (type_gen_params != null)
                                param.Index = type_gen_params.GetGenericParamNum (param.Name);

                        if (param.Index < 0)
                                Report.Error (String.Format ("Invalid {0}type parameter '{1}'", 
                                                        (param.Type == PEAPI.GenParamType.MVar ? "method " : ""),
                                                         param.Name));
                }