private RuntimeType?GetBaseType() { if (IsInterface) { return(null); } if (RuntimeTypeHandle.IsGenericVariable(this)) { Type[] constraints = GetGenericParameterConstraints(); RuntimeType baseType = ObjectType; for (int i = 0; i < constraints.Length; i++) { RuntimeType constraint = (RuntimeType)constraints[i]; if (constraint.IsInterface) { continue; } if (constraint.IsGenericParameter) { GenericParameterAttributes special; special = constraint.GenericParameterAttributes & GenericParameterAttributes.SpecialConstraintMask; if ((special & GenericParameterAttributes.ReferenceTypeConstraint) == 0 && (special & GenericParameterAttributes.NotNullableValueTypeConstraint) == 0) { continue; } } baseType = constraint; } if (baseType == ObjectType) { GenericParameterAttributes special; special = GenericParameterAttributes & GenericParameterAttributes.SpecialConstraintMask; if ((special & GenericParameterAttributes.NotNullableValueTypeConstraint) != 0) { baseType = ValueType; } } return(baseType); } return(RuntimeTypeHandle.GetBaseType(this)); }