3 instantiations of TypeParameterConstraintClause
Microsoft.CodeAnalysis.CSharp (3)
Symbols\Source\TypeParameterConstraintClause.cs (3)
74internal static readonly TypeParameterConstraintClause Empty = new TypeParameterConstraintClause( 78internal static readonly TypeParameterConstraintClause ObliviousNullabilityIfReferenceType = new TypeParameterConstraintClause( 99return new TypeParameterConstraintClause(constraints, constraintTypes);
64 references to TypeParameterConstraintClause
Microsoft.CodeAnalysis.CSharp (64)
Binder\Binder_Constraints.cs (14)
23internal ImmutableArray<TypeParameterConstraintClause> BindTypeParameterConstraintClauses( 54var results = ArrayBuilder<TypeParameterConstraintClause?>.GetInstance(n, fillWithValue: null); 68(TypeParameterConstraintClause constraintClause, ArrayBuilder<TypeConstraintSyntax>? typeConstraintNodes) = this.BindTypeParameterConstraints(typeParameterList.Parameters[ordinal], clause, isForOverride, diagnostics); 117private (TypeParameterConstraintClause, ArrayBuilder<TypeConstraintSyntax>?) BindTypeParameterConstraints( 347return (TypeParameterConstraintClause.Create(constraints, constraintTypes?.ToImmutableAndFree() ?? ImmutableArray<TypeWithAnnotations>.Empty), syntaxBuilder); 364internal ImmutableArray<TypeParameterConstraintClause> GetDefaultTypeParameterConstraintClauses(TypeParameterListSyntax typeParameterList) 366var builder = ArrayBuilder<TypeParameterConstraintClause>.GetInstance(typeParameterList.Parameters.Count); 376private TypeParameterConstraintClause GetDefaultTypeParameterConstraintClause(TypeParameterSyntax typeParameterSyntax, bool isForOverride = false) 378return isForOverride || AreNullableAnnotationsEnabled(typeParameterSyntax.Identifier) ? TypeParameterConstraintClause.Empty : TypeParameterConstraintClause.ObliviousNullabilityIfReferenceType; 386ArrayBuilder<TypeParameterConstraintClause> constraintClauses, 400private static TypeParameterConstraintClause RemoveInvalidConstraints( 402TypeParameterConstraintClause constraintClause, 436return TypeParameterConstraintClause.Create(constraintClause.Constraints, constraintTypeBuilder.ToImmutableAndFree());
Symbols\ConstraintsHelper.cs (10)
362ImmutableArray<TypeParameterConstraintClause> clauses; 386ImmutableArray<TypeParameterConstraintClause> clauses; 415internal static ImmutableArray<TypeParameterConstraintClause> AdjustConstraintKindsBasedOnConstraintTypes(ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeParameterConstraintClause> constraintClauses) 421SmallDictionary<TypeParameterSymbol, bool> isValueTypeMap = TypeParameterConstraintClause.BuildIsValueTypeMap(typeParameters, constraintClauses); 422SmallDictionary<TypeParameterSymbol, bool> isReferenceTypeFromConstraintTypesMap = TypeParameterConstraintClause.BuildIsReferenceTypeFromConstraintTypesMap(typeParameters, constraintClauses); 423ArrayBuilder<TypeParameterConstraintClause> builder = null; 427var constraint = constraintClauses[i]; 447builder = ArrayBuilder<TypeParameterConstraintClause>.GetInstance(constraintClauses.Length); 451builder[i] = TypeParameterConstraintClause.Create(constraintKind, constraint.ConstraintTypes);
Symbols\Source\SourceNamedTypeSymbol.cs (28)
317var results = ImmutableArray<TypeParameterConstraintClause>.Empty; 323ArrayBuilder<ImmutableArray<TypeParameterConstraintClause>> otherPartialClauses = null; 337ImmutableArray<TypeParameterConstraintClause> constraints; 365(otherPartialClauses ??= ArrayBuilder<ImmutableArray<TypeParameterConstraintClause>>.GetInstance()).Add(constraints); 373results = ImmutableArray<TypeParameterConstraintClause>.Empty; 398var results = ImmutableArray<TypeParameterConstraintClause>.Empty; 404ArrayBuilder<ImmutableArray<TypeParameterConstraintClause>> otherPartialClauses = null; 418ImmutableArray<TypeParameterConstraintClause> constraints; 447(otherPartialClauses ??= ArrayBuilder<ImmutableArray<TypeParameterConstraintClause>>.GetInstance()).Add(constraints); 456results = ImmutableArray<TypeParameterConstraintClause>.Empty; 489private ImmutableArray<TypeParameterConstraintClause> MergeConstraintTypesForPartialDeclarations(ImmutableArray<TypeParameterConstraintClause> constraintClauses, 490ArrayBuilder<ImmutableArray<TypeParameterConstraintClause>> otherPartialClauses, 498ArrayBuilder<TypeParameterConstraintClause> builder = null; 506var constraint = constraintClauses[i]; 515foreach (ImmutableArray<TypeParameterConstraintClause> otherPartialConstraints in otherPartialClauses) 541builder = ArrayBuilder<TypeParameterConstraintClause>.GetInstance(constraintClauses.Length); 545builder[i] = TypeParameterConstraintClause.Create(constraint.Constraints, 559TypeParameterConstraintClause clause) 643private ImmutableArray<TypeParameterConstraintClause> MergeConstraintKindsForPartialDeclarations(ImmutableArray<TypeParameterConstraintClause> constraintClauses, 644ArrayBuilder<ImmutableArray<TypeParameterConstraintClause>> otherPartialClauses) 651ArrayBuilder<TypeParameterConstraintClause> builder = null; 659var constraint = constraintClauses[i]; 664foreach (ImmutableArray<TypeParameterConstraintClause> otherPartialConstraints in otherPartialClauses) 680builder = ArrayBuilder<TypeParameterConstraintClause>.GetInstance(constraintClauses.Length); 684builder[i] = TypeParameterConstraintClause.Create(mergedKind, originalConstraintTypes); 695static void mergeConstraints(ref TypeParameterConstraintKind mergedKind, ImmutableArray<TypeWithAnnotations> originalConstraintTypes, TypeParameterConstraintClause clause)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (3)
113private (TypeWithAnnotations ReturnType, ImmutableArray<ParameterSymbol> Parameters, ImmutableArray<TypeParameterConstraintClause> DeclaredConstraintsForOverrideOrImplementation) MakeParametersAndBindReturnType(BindingDiagnosticBag diagnostics) 155ImmutableArray<TypeParameterConstraintClause> declaredConstraints = default; 187static void forceMethodTypeParameters(TypeWithAnnotations type, SourceOrdinaryMethodSymbol method, ImmutableArray<TypeParameterConstraintClause> declaredConstraints)
Symbols\Source\TypeParameterConstraintClause.cs (9)
74internal static readonly TypeParameterConstraintClause Empty = new TypeParameterConstraintClause( 78internal static readonly TypeParameterConstraintClause ObliviousNullabilityIfReferenceType = new TypeParameterConstraintClause( 82internal static TypeParameterConstraintClause Create( 134ImmutableArray<TypeParameterConstraintClause> constraintClauses) 147static bool isValueType(TypeParameterSymbol thisTypeParameter, ImmutableArray<TypeParameterConstraintClause> constraintClauses, SmallDictionary<TypeParameterSymbol, bool> isValueTypeMap, ConsList<TypeParameterSymbol> inProgress) 159TypeParameterConstraintClause constraintClause = constraintClauses[thisTypeParameter.Ordinal]; 199ImmutableArray<TypeParameterConstraintClause> constraintClauses) 212static bool isReferenceTypeFromConstraintTypes(TypeParameterSymbol thisTypeParameter, ImmutableArray<TypeParameterConstraintClause> constraintClauses, 225TypeParameterConstraintClause constraintClause = constraintClauses[thisTypeParameter.Ordinal];