1 write to Constraints
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Source\TypeParameterConstraintClause.cs (1)
124this.Constraints = constraints;
21 references to Constraints
Microsoft.CodeAnalysis.CSharp (21)
Binder\Binder_Constraints.cs (2)
424if (IsValidConstraint(typeParameter, syntax, constraintType, constraintClause.Constraints, constraintTypeBuilder, performOnlyCycleSafeValidation, diagnostics)) 437return TypeParameterConstraintClause.Create(constraintClause.Constraints, constraintTypeBuilder.ToImmutableAndFree());
Symbols\ConstraintsHelper.cs (3)
407if (clauses.All(clause => clause.Constraints == TypeParameterConstraintKind.None)) 429TypeParameterConstraintKind constraintKind = constraint.Constraints; 443if (constraint.Constraints != constraintKind)
Symbols\Source\SourceNamedTypeSymbol.cs (13)
457if (results.All(clause => clause.Constraints == TypeParameterConstraintKind.None)) 549builder[i] = TypeParameterConstraintClause.Create(constraint.Constraints, 665TypeParameterConstraintKind mergedKind = constraint.Constraints; 673if (constraint.Constraints != mergedKind) 675Debug.Assert((constraint.Constraints & (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)) == 678(constraint.Constraints & TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) != 0); 679Debug.Assert((constraint.Constraints & TypeParameterConstraintKind.AllReferenceTypeKinds) == (mergedKind & TypeParameterConstraintKind.AllReferenceTypeKinds) || 680(constraint.Constraints & TypeParameterConstraintKind.AllReferenceTypeKinds) == TypeParameterConstraintKind.ReferenceType); 701if ((mergedKind & (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)) != (clause.Constraints & (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull))) 706if ((mergedKind & TypeParameterConstraintKind.ReferenceType) != 0 && (clause.Constraints & TypeParameterConstraintKind.ReferenceType) != 0) 710TypeParameterConstraintKind clause2Constraints = clause.Constraints & TypeParameterConstraintKind.AllReferenceTypeKinds; 729if (((mergedKind | clause.Constraints) & ~(TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType | TypeParameterConstraintKind.Constructor)) == 0 && 731(clause.Constraints & TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) == 0) // 'object?'
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
195(args.declaredConstraints[typeParameterSymbol.Ordinal].Constraints & (TypeParameterConstraintKind.ReferenceType | TypeParameterConstraintKind.Default)) == 0; 658switch (declaredConstraints[i].Constraints & (TypeParameterConstraintKind.ReferenceType | TypeParameterConstraintKind.ValueType | TypeParameterConstraintKind.Default))
Symbols\Source\TypeParameterConstraintClause.cs (1)
162if ((constraintClause.Constraints & TypeParameterConstraintKind.AllValueTypeKinds) != 0)