42 references to ConstraintsHelper
Microsoft.CodeAnalysis.CSharp (42)
Binder\Binder_Conversions.cs (3)
539.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(Compilation, Conversions, includeNullability: false, syntax.Location, diagnostics)); 1067new ConstraintsHelper.CheckConstraintsArgs(Compilation, Conversions, syntax.Location, diagnostics)); 2641return !methodSymbol.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, node.Location, diagnostics));
Binder\Binder_Expressions.cs (4)
11148if (!ConstraintsHelper.RequiresChecking(method)) 11156bool constraintsSatisfied = ConstraintsHelper.CheckMethodConstraints( 11158new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null), 11270new ConstraintsHelper.CheckConstraintsArgs(compilation, conversions, includeNullability: false, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded),
Binder\Binder_Invocation.cs (1)
1014(typeArgumentsOpt.IsDefault || ((MethodSymbol)(object)result.Member).CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, syntax.Location, candidateDiagnostics))))
Binder\Binder_Symbols.cs (3)
565type.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: true, location, diagnostics)); 1587if (ShouldCheckConstraints && ConstraintsHelper.RequiresChecking(type)) 1590type.CheckConstraintsForNamedType(new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability, typeSyntax.Location, diagnostics),
Binder\Semantics\OverloadResolution\OverloadResolution.cs (4)
802var constraintsArgs = new ConstraintsHelper.CheckConstraintsArgs(this.Compilation, this.Conversions, includeNullability: false, location: NoLocation.Singleton, diagnostics: null, template); 807constraintsSatisfied &= ConstraintsHelper.CheckMethodConstraints( 815if (member.GetIsNewExtensionMember() && member.ContainingType is { } extension && ConstraintsHelper.RequiresChecking(extension)) 817constraintsSatisfied &= ConstraintsHelper.CheckConstraints(extension, in constraintsArgs,
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
1046if (!method.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, conversions, includeNullability: false, location, diagnostics))) 1058var boxedArgs = ConstraintsHelper.CheckConstraintsArgsBoxed.Allocate(compilation, conversions, includeNullability: false, location, diagnostics);
FlowAnalysis\NullableWalker.cs (6)
6988if (ConstraintsHelper.RequiresChecking(method)) 8174ConstraintsHelper.CheckMethodConstraints( 8176new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, NoLocation.Singleton, diagnostics: null, template: CompoundUseSiteInfo<AssemblySymbol>.Discarded), 8606tupleOpt.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, _conversions, includeNullability: true, node.Syntax.Location, diagnostics: null), 10007if (ConstraintsHelper.RequiresChecking(method)) 10370if (ConstraintsHelper.RequiresChecking(deconstructMethod))
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
631onCompleted.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(F.Compilation, F.Compilation.Conversions, includeNullability: false, F.Syntax.Location, this.Diagnostics));
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
258startMethod.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(F.Compilation, F.Compilation.Conversions, includeNullability: false, F.Syntax.Location, diagnostics));
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
175if (!interceptor.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(this._compilation, this._compilation.Conversions, includeNullability: true, attributeLocation, this._diagnostics)))
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (2)
680if (linqToArrayMethod.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, Location.None, BindingDiagnosticBag.Discarded)) 862if (spanOfElementType.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, Location.None, BindingDiagnosticBag.Discarded)))
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (1)
343method.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, syntax.GetLocation(), _diagnostics));
Symbols\AbstractTypeMap.cs (1)
379result[mergeWith] = ConstraintsHelper.ConstraintWithMostSignificantNullability(result[mergeWith], substituted);
Symbols\MemberSymbolExtensions.cs (1)
231var constraintArgs = new ConstraintsHelper.CheckConstraintsArgs(compilation, conversions, includeNullability: false,
Symbols\Metadata\PE\PETypeParameterSymbol.cs (3)
185if (ConstraintsHelper.IsObjectConstraint(type, ref bestObjectConstraint)) 196if (ConstraintsHelper.IsObjectConstraintSignificant(CalculateIsNotNullableFromNonTypeConstraints(), bestObjectConstraint)) 211if (!ConstraintsHelper.IsObjectConstraintSignificant(IsNotNullableFromConstraintType(constraintType, inProgress, out _), bestObjectConstraint))
Symbols\ReducedExtensionMethodSymbol.cs (1)
207var success = method.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, conversions, includeNullability: false, NoLocation.Singleton, diagnostics: null, template: new CompoundUseSiteInfo<AssemblySymbol>(useSiteInfo)),
Symbols\Source\SourceNamedTypeSymbol.cs (1)
454results = ConstraintsHelper.AdjustConstraintKindsBasedOnConstraintTypes(typeParameters, results);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
203var constraintArgs = new ConstraintsHelper.CheckConstraintsArgs(compilation, conversions, includeNullability: false,
Symbols\Source\SourceTypeParameterSymbol.cs (1)
262var args = ConstraintsHelper.CheckConstraintsArgsBoxed.Allocate(
Symbols\SubstitutedTypeParameterSymbol.cs (3)
110if (ConstraintsHelper.IsObjectConstraint(type, ref bestObjectConstraint)) 119if (ConstraintsHelper.IsObjectConstraintSignificant(CalculateIsNotNullableFromNonTypeConstraints(), bestObjectConstraint)) 133if (!ConstraintsHelper.IsObjectConstraintSignificant(IsNotNullableFromConstraintType(constraintType, out _), bestObjectConstraint))
Symbols\Tuples\TupleTypeSymbol.cs (1)
66constructedType.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(compilation, compilation.Conversions, includeNullability, syntax.Location, diagnostics),