31 references to ConstraintClauses
ILLink.CodeFixProvider (1)
RequiresUnsafeCodeFixProvider.cs (1)
520
foreach (var constraint in method.
ConstraintClauses
)
Microsoft.CodeAnalysis.CSharp (19)
_generated\0\Syntax.xml.Main.Generated.cs (1)
2071
=> node.Update(VisitList(node.AttributeLists), VisitList(node.Modifiers), (TypeSyntax?)Visit(node.ReturnType) ?? throw new ArgumentNullException("returnType"), (ExplicitInterfaceSpecifierSyntax?)Visit(node.ExplicitInterfaceSpecifier), VisitToken(node.Identifier), (TypeParameterListSyntax?)Visit(node.TypeParameterList), (ParameterListSyntax?)Visit(node.ParameterList) ?? throw new ArgumentNullException("parameterList"), VisitList(node.
ConstraintClauses
), (BlockSyntax?)Visit(node.Body), (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody), VisitToken(node.SemicolonToken));
_generated\2\Syntax.xml.Syntax.Generated.cs (12)
12413
if (attributeLists != this.AttributeLists || modifiers != this.Modifiers || returnType != this.ReturnType || explicitInterfaceSpecifier != this.ExplicitInterfaceSpecifier || identifier != this.Identifier || typeParameterList != this.TypeParameterList || parameterList != this.ParameterList || constraintClauses != this.
ConstraintClauses
|| body != this.Body || expressionBody != this.ExpressionBody || semicolonToken != this.SemicolonToken)
12424
public new MethodDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12426
public new MethodDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12427
public MethodDeclarationSyntax WithReturnType(TypeSyntax returnType) => Update(this.AttributeLists, this.Modifiers, returnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12428
public MethodDeclarationSyntax WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifierSyntax? explicitInterfaceSpecifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, explicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12429
public MethodDeclarationSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12430
public MethodDeclarationSyntax WithTypeParameterList(TypeParameterListSyntax? typeParameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, typeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12432
public new MethodDeclarationSyntax WithParameterList(ParameterListSyntax parameterList) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, parameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, this.SemicolonToken);
12435
public new MethodDeclarationSyntax WithBody(BlockSyntax? body) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, body, this.ExpressionBody, this.SemicolonToken);
12437
public new MethodDeclarationSyntax WithExpressionBody(ArrowExpressionClauseSyntax? expressionBody) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, expressionBody, this.SemicolonToken);
12439
public new MethodDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.ReturnType, this.ExplicitInterfaceSpecifier, this.Identifier, this.TypeParameterList, this.ParameterList, this.
ConstraintClauses
, this.Body, this.ExpressionBody, semicolonToken);
12452
public MethodDeclarationSyntax AddConstraintClauses(params TypeParameterConstraintClauseSyntax[] items) => WithConstraintClauses(this.
ConstraintClauses
.AddRange(items));
Symbols\Source\SourceOrdinaryMethodSymbol.cs (6)
82
ReportErrorIfHasConstraints(syntax.
ConstraintClauses
, diagnostics.DiagnosticBag);
166
if (syntax.
ConstraintClauses
.Count > 0)
169
syntax.
ConstraintClauses
[0].WhereKeyword, MessageID.IDS_OverrideWithConstraints, diagnostics);
172
BindTypeParameterConstraintClauses(this, TypeParameters, syntax.TypeParameterList, syntax.
ConstraintClauses
,
1090
syntax.
ConstraintClauses
,
1117
syntax.
ConstraintClauses
);
Microsoft.CodeAnalysis.CSharp.Features (5)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
244
constraintClauses: otherMethod.
ConstraintClauses
,
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (3)
346
if (extensionMethod.
ConstraintClauses
.Count == 0 || movedTypeParameterCount == 0)
347
return extensionMethod.
ConstraintClauses
;
350
return [.. extensionMethod.
ConstraintClauses
.Where(
Organizing\Organizers\MethodDeclarationOrganizer.cs (1)
37
constraintClauses: syntax.
ConstraintClauses
,
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpDetectPreviewFeatureAnalyzer.cs (1)
207
SyntaxList<TypeParameterConstraintClauseSyntax> constraintClauses = methodDeclaration.
ConstraintClauses
;
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (5)
621
if (method.
ConstraintClauses
.Count > 0)
623
return RemoveNodes(method, method.
ConstraintClauses
);
1787
if (method.
ConstraintClauses
.Count == 0)
1792
method.ParameterList.GetTrailingTrivia().Add(SyntaxFactory.ElasticMarker).AddRange(method.
ConstraintClauses
.Last().GetTrailingTrivia())));
1817
MethodDeclarationSyntax method => method.WithConstraintClauses(WithTypeConstraints(method.
ConstraintClauses
, typeParameterName, kinds, isUnmanagedType, types)),