Ejemplo n.º 1
0
        /* Resolve any GenParams in constraints, parent & impl_list */
        private void ResolveGenParams()
        {
            if (gen_params == null)
            {
                return;
            }

            gen_params.ResolveConstraints(gen_params, null);

            BaseGenericTypeRef gtr = parent as BaseGenericTypeRef;

            if (gtr != null)
            {
                gtr.Resolve(gen_params, null);
            }

            if (impl_list == null)
            {
                return;
            }

            foreach (BaseClassRef impl in impl_list)
            {
                gtr = impl as BaseGenericTypeRef;
                if (gtr != null)
                {
                    gtr.Resolve(gen_params, null);
                }
            }
        }
Ejemplo n.º 2
0
        public void ResolveGenParams()
        {
            GenericParameters type_params = (type_def != null) ? type_def.TypeParameters : null;

            if (gen_params == null && type_params == null)
            {
                return;
            }

            if (gen_params != null)
            {
                gen_params.ResolveConstraints(type_params, gen_params);
            }

            BaseGenericTypeRef gtr = RetType as BaseGenericTypeRef;

            if (gtr != null)
            {
                gtr.Resolve(type_params, gen_params);
            }

            if (param_list == null)
            {
                return;
            }

            foreach (ParamDef param in param_list)
            {
                gtr = param.Type as BaseGenericTypeRef;
                if (gtr != null)
                {
                    gtr.Resolve(type_params, gen_params);
                }
            }
        }
 public void Resolve(GenericParameters type_gen_params, GenericParameters method_gen_params)
 {
     foreach (BaseTypeRef type in type_list)
     {
         BaseGenericTypeRef gtr = type as BaseGenericTypeRef;
         if (gtr != null)
         {
             gtr.Resolve(type_gen_params, method_gen_params);
         }
     }
     /* Reset, might have changed (think GenericParamRef) */
     type_str = null;
 }
Ejemplo n.º 4
0
        public void ResolveConstraints(GenericParameters type_gen_params, GenericParameters method_gen_params)
        {
            if (constraintsList == null)
            {
                return;
            }

            foreach (BaseTypeRef constraint in constraintsList)
            {
                BaseGenericTypeRef gtr = constraint as BaseGenericTypeRef;
                if (gtr != null)
                {
                    gtr.Resolve(type_gen_params, method_gen_params);
                }
            }
        }
Ejemplo n.º 5
0
        public PEAPI.Local GetPeapiLocal(CodeGen code_gen)
        {
            int ec = Report.ErrorCount;
            BaseGenericTypeRef gtr = type as BaseGenericTypeRef;

            if (gtr == null)
            {
                type.Resolve(code_gen);
            }
            else
            {
                gtr.ResolveNoTypeSpec(code_gen);
            }

            if (Report.ErrorCount > ec)
            {
                return(null);
            }

            return(new PEAPI.Local(name, type.PeapiType));
        }