Exemple #1
0
 public static List<generic_parameter_eliminations> make_eliminations_compiled(Type[] pars)
 {
     List<generic_parameter_eliminations> _parameters_eliminations = new List<generic_parameter_eliminations>();
     foreach (Type t in pars)
     {
         generic_parameter_eliminations gpe = new generic_parameter_eliminations();
         gpe.has_default_ctor =
             ((t.GenericParameterAttributes &
             GenericParameterAttributes.DefaultConstructorConstraint) != 0);
         gpe.is_class =
             ((t.GenericParameterAttributes &
             GenericParameterAttributes.ReferenceTypeConstraint) != 0);
         gpe.is_value =
             ((t.GenericParameterAttributes &
             GenericParameterAttributes.NotNullableValueTypeConstraint) != 0);
         gpe.base_class = compiled_type_node.get_type_node(t.BaseType);
         Type[] net_interf = t.GetInterfaces();
         gpe.implementing_interfaces = new List<type_node>(net_interf.Length);
         foreach (Type net_t in net_interf)
         {
             gpe.implementing_interfaces.Add(compiled_type_node.get_type_node(net_t));
         }
         _parameters_eliminations.Add(gpe);
     }
     return _parameters_eliminations;
 }
Exemple #2
0
 public static List<generic_parameter_eliminations> make_eliminations_common(List<SemanticTree.ICommonTypeNode> generic_params)
 {
     List<generic_parameter_eliminations> _parameters_eliminations = new List<generic_parameter_eliminations>();
     foreach (type_node t in generic_params)
     {
         generic_parameter_eliminations gpe = new generic_parameter_eliminations();
         gpe.has_default_ctor = generic_convertions.type_has_default_ctor(t, false);
         gpe.is_class = t.is_class;
         gpe.is_value = t.is_value;
         gpe.base_class = t.base_type;
         gpe.implementing_interfaces = new List<type_node>(t.ImplementingInterfaces.Count);
         foreach (type_node interf in t.ImplementingInterfaces)
         {
             gpe.implementing_interfaces.Add(interf);
         }
         _parameters_eliminations.Add(gpe);
     }
     return _parameters_eliminations;
 }