AddContraintGenericTypeVarArg() public method

public AddContraintGenericTypeVarArg ( GenericTypeVar g ) : void
g GenericTypeVar
return void
Example #1
0
        public static void CheckBoundParameterizedTypeImpl(GenericTypeVar g, Type bound)
        {
            TypeInfo typeInfo = bound.GetTypeInfo();

            if (typeInfo.IsGenericType)
            {
                g.ConstraintClassDescriptor = ClassDescriptor.GetClassDescriptor(bound);

                Type[] types = typeInfo.GenericTypeArguments;

                foreach (Type type in types)
                {
                    g.AddContraintGenericTypeVarArg(GenericTypeVar.GetGenericTypeVarRef(type, g.Scope));
                }
            }
        }
Example #2
0
        public static void CheckBoundParameterizedTypeImpl(GenericTypeVar g, Type bound)
        {
            TypeInfo typeInfo = bound.GetTypeInfo();
            if (typeInfo.IsGenericType)
            {
                g.ConstraintClassDescriptor = ClassDescriptor.GetClassDescriptor(bound);

                Type[] types = typeInfo.GenericTypeArguments;

                foreach (Type type in types)
                {
                    g.AddContraintGenericTypeVarArg(GenericTypeVar.GetGenericTypeVarRef(type, g.Scope));
                }
            }
        }