36 references to SpecialTypeConstraintKind
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
CodeGeneration\CSharpSyntaxGenerator.cs (5)
1823public override SyntaxNode WithTypeConstraint(SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, IEnumerable<SyntaxNode>? types) 1840SyntaxList<TypeParameterConstraintClauseSyntax> clauses, string typeParameterName, SpecialTypeConstraintKind kinds, IEnumerable<SyntaxNode>? types) 1846if ((kinds & SpecialTypeConstraintKind.Constructor) != 0) 1851var isReferenceType = (kinds & SpecialTypeConstraintKind.ReferenceType) != 0; 1852var isValueType = (kinds & SpecialTypeConstraintKind.ValueType) != 0;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (8)
CodeGeneration\SyntaxGeneratorTests.cs (8)
2085"a", SpecialTypeConstraintKind.Constructor), 2091"a", SpecialTypeConstraintKind.ReferenceType), 2097"a", SpecialTypeConstraintKind.ValueType), 2103"a", SpecialTypeConstraintKind.ReferenceType | SpecialTypeConstraintKind.Constructor), 2109"a", SpecialTypeConstraintKind.ReferenceType | SpecialTypeConstraintKind.ValueType), 2115"a", SpecialTypeConstraintKind.ReferenceType, Generator.IdentifierName("b"), Generator.IdentifierName("c")),
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
CodeGeneration\VisualBasicSyntaxGenerator.vb (4)
2872Public Overrides Function WithTypeConstraint(declaration As SyntaxNode, typeParameterName As String, kinds As SpecialTypeConstraintKind, Optional types As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 2879If (kinds And SpecialTypeConstraintKind.Constructor) <> 0 Then 2883Dim isReferenceType = (kinds And SpecialTypeConstraintKind.ReferenceType) <> 0 2884Dim isValueType = (kinds And SpecialTypeConstraintKind.ValueType) <> 0
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (8)
CodeGeneration\SyntaxGeneratorTests.vb (8)
2007"a", SpecialTypeConstraintKind.Constructor), 2014"a", SpecialTypeConstraintKind.ReferenceType), 2021"a", SpecialTypeConstraintKind.ValueType), 2028"a", SpecialTypeConstraintKind.ReferenceType Or SpecialTypeConstraintKind.Constructor), 2035"a", SpecialTypeConstraintKind.ValueType Or SpecialTypeConstraintKind.Constructor), 2042"a", SpecialTypeConstraintKind.ReferenceType, Generator.IdentifierName("b"), Generator.IdentifierName("c")),
Microsoft.CodeAnalysis.Workspaces (11)
Editing\SyntaxEditorExtensions.cs (1)
37public static void SetTypeConstraint(this SyntaxEditor editor, SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kind, IEnumerable<SyntaxNode> types)
Editing\SyntaxGenerator.cs (10)
212decl = WithTypeConstraint(decl, typeParameter.Name, SpecialTypeConstraintKind.ReferenceType); 883kinds: (tp.HasConstructorConstraint ? SpecialTypeConstraintKind.Constructor : SpecialTypeConstraintKind.None) 884| (tp.HasReferenceTypeConstraint ? SpecialTypeConstraintKind.ReferenceType : SpecialTypeConstraintKind.None) 885| (tp.HasValueTypeConstraint ? SpecialTypeConstraintKind.ValueType : SpecialTypeConstraintKind.None), 917public abstract SyntaxNode WithTypeConstraint(SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, IEnumerable<SyntaxNode>? types = null); 924public SyntaxNode WithTypeConstraint(SyntaxNode declaration, string typeParameterName, SpecialTypeConstraintKind kinds, params SyntaxNode[] types) 931=> WithTypeConstraint(declaration, typeParameterName, SpecialTypeConstraintKind.None, (IEnumerable<SyntaxNode>)types);