1 write to Constraints
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\TypeParameterConstraintClause.cs (1)
124
this.
Constraints
= constraints;
23 references to Constraints
Microsoft.CodeAnalysis.CSharp (23)
Binder\Binder_Constraints.cs (2)
424
if (IsValidConstraint(typeParameter, syntax, constraintType, constraintClause.
Constraints
, constraintTypeBuilder, performOnlyCycleSafeValidation, diagnostics))
437
return TypeParameterConstraintClause.Create(constraintClause.
Constraints
, constraintTypeBuilder.ToImmutableAndFree());
Symbols\ConstraintsHelper.cs (4)
407
if (clauses.All(clause => clause.
Constraints
== TypeParameterConstraintKind.None))
412
return clauses.SelectAsArray(clause => clause.
Constraints
);
429
TypeParameterConstraintKind constraintKind = constraint.
Constraints
;
443
if (constraint.
Constraints
!= constraintKind)
Symbols\Source\SourceNamedTypeSymbol.cs (14)
458
if (results.All(clause => clause.
Constraints
== TypeParameterConstraintKind.None))
466
return results.SelectAsArray(clause => clause.
Constraints
);
550
builder[i] = TypeParameterConstraintClause.Create(constraint.
Constraints
,
666
TypeParameterConstraintKind mergedKind = constraint.
Constraints
;
674
if (constraint.
Constraints
!= mergedKind)
676
Debug.Assert((constraint.
Constraints
& (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)) ==
679
(constraint.
Constraints
& TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) != 0);
680
Debug.Assert((constraint.
Constraints
& TypeParameterConstraintKind.AllReferenceTypeKinds) == (mergedKind & TypeParameterConstraintKind.AllReferenceTypeKinds) ||
681
(constraint.
Constraints
& TypeParameterConstraintKind.AllReferenceTypeKinds) == TypeParameterConstraintKind.ReferenceType);
702
if ((mergedKind & (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)) != (clause.
Constraints
& (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)))
707
if ((mergedKind & TypeParameterConstraintKind.ReferenceType) != 0 && (clause.
Constraints
& TypeParameterConstraintKind.ReferenceType) != 0)
711
TypeParameterConstraintKind clause2Constraints = clause.
Constraints
& TypeParameterConstraintKind.AllReferenceTypeKinds;
730
if (((mergedKind | clause.
Constraints
) & ~(TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType | TypeParameterConstraintKind.Constructor)) == 0 &&
732
(clause.
Constraints
& TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) == 0) // 'object?'
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
196
(args.declaredConstraints[typeParameterSymbol.Ordinal].
Constraints
& (TypeParameterConstraintKind.ReferenceType | TypeParameterConstraintKind.Default)) == 0;
678
switch (declaredConstraints[i].
Constraints
& (TypeParameterConstraintKind.ReferenceType | TypeParameterConstraintKind.ValueType | TypeParameterConstraintKind.Default))
Symbols\Source\TypeParameterConstraintClause.cs (1)
162
if ((constraintClause.
Constraints
& TypeParameterConstraintKind.AllValueTypeKinds) != 0)