Exemplo n.º 1
0
 public TypeParameterSymbolInfo(Type type) : base(type)
 {
     Ordinal = type.GenericParameterPosition;
     HasReferenceTypeConstraint = (type.GenericParameterAttributes & GenericParameterAttributes.ReferenceTypeConstraint) == GenericParameterAttributes.ReferenceTypeConstraint;
     HasValueTypeConstraint     = (type.GenericParameterAttributes & GenericParameterAttributes.NotNullableValueTypeConstraint) == GenericParameterAttributes.NotNullableValueTypeConstraint;
     HasConstructorConstraint   = (type.GenericParameterAttributes & GenericParameterAttributes.DefaultConstructorConstraint) == GenericParameterAttributes.DefaultConstructorConstraint;
     RefKind         = type.GenericParameterAttributes.ConvertToStructure();
     ConstraintTypes = EnumerableExtensions.CreateLazyImmutableArray(() => RealType.GetGenericParameterConstraints().Where(i => i != typeof(ValueType)).Select(i => i.GetSymbolInfo()));
 }