2 implementations of ConstraintTypes
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeParameterSymbol.cs (1)
62ImmutableArray<ITypeSymbol> ITypeParameterSymbol.ConstraintTypes
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeParameterSymbol.vb (1)
393Private ReadOnly Property ITypeParameterSymbol_ConstraintTypes As ImmutableArray(Of ITypeSymbol) Implements ITypeParameterSymbol.ConstraintTypes
86 references to ConstraintTypes
ILLink.RoslynAnalyzer (2)
TrimAnalysis\GenericParameterProxy.cs (1)
19 foreach (ITypeSymbol constraintType in TypeParameterSymbol.ConstraintTypes) {
TrimAnalysis\HandleCallAction.cs (1)
94 foreach (var constraintType in genericParam.ConstraintTypes) {
Microsoft.CodeAnalysis.CodeStyle (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
103return symbol.ConstraintTypes.Any(static (ts, self) => ts.Accept(self), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeParameterSymbolExtensions.cs (1)
13=> typeParameter.ConstraintTypes.Select(GetNamedTypeSymbol).WhereNotNull().FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (1)
85foreach (var constraint in symbol.ConstraintTypes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
615foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (4)
232if (typeParameter1.ConstraintTypes.Length != typeParameter2.ConstraintTypes.Length) 237return typeParameter1.ConstraintTypes.SetEquals( 238typeParameter2.ConstraintTypes, this.SignatureTypeEquivalenceComparer);
Microsoft.CodeAnalysis.CodeStyle.Fixes (14)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
60var constraints = typeParameter.ConstraintTypes.Where(ts => !ts.IsUnexpressibleTypeParameterConstraint()).ToList(); 66if (constraints.SequenceEqual(typeParameter.ConstraintTypes))
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (6)
64switch (symbol.ConstraintTypes.Length) 74if (symbol.ConstraintTypes.ElementAt(0) is INamedTypeSymbol namedType) 87if (!symbol.ConstraintTypes.All(t => t is INamedTypeSymbol)) 94(INamedTypeSymbol)symbol.ConstraintTypes[0], projects).ConfigureAwait(false); 96for (var i = 1; i < symbol.ConstraintTypes.Length; i++) 99(INamedTypeSymbol)symbol.ConstraintTypes[i], projects).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
319var constraints = typeParameter.ConstraintTypes;
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
182foreach (var constraint in typeParameter.ConstraintTypes)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
270var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2; 271var condition2 = typeParameter.ConstraintTypes.Any(static (ts, allowDelegateAndEnumConstraints) => ts.IsUnexpressibleTypeParameterConstraint(allowDelegateAndEnumConstraints), allowDelegateAndEnumConstraints); 272var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
121typeParameter.ConstraintTypes,
Microsoft.CodeAnalysis.CSharp (3)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (3)
838return !typeParam.ConstraintTypes.IsEmpty || typeParam.HasConstructorConstraint || 907for (int i = 0; i < typeParam.ConstraintTypes.Length; i++) 909ITypeSymbol baseType = typeParam.ConstraintTypes[i];
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (3)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 62typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
14333var m5Tuple = ((IMethodSymbol)symbolInfo.Symbol).TypeParameters[0].ConstraintTypes.Single();
Microsoft.CodeAnalysis.CSharp.Features (2)
SignatureHelp\GenericNameSignatureHelpProvider.cs (2)
263foreach (var baseType in typeParam.ConstraintTypes) 311return !typeParam.ConstraintTypes.IsDefaultOrEmpty || typeParam.HasConstructorConstraint ||
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\NullablePublicAPITests.cs (1)
826var result = typeParameterSymbol.ConstraintTypes.Single().NullableAnnotation;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
85CheckISymbols(symbol.ConstraintTypes, constraintTypes);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (3)
60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 62typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
38foreach (var constraintType in symbol.ConstraintTypes)
Microsoft.CodeAnalysis.Features (20)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
488foreach (var constraintType in typeParameter.ConstraintTypes)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
2409=> TypesEquivalent(oldParameter.ConstraintTypes, newParameter.ConstraintTypes, exact) &&
ExtractMethod\MethodExtractor.Analyzer.cs (2)
773var constraintTypes = typeParameter.ConstraintTypes; 832var constraintTypes = typeParameter.ConstraintTypes;
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
132foreach (var constraint in symbol.ConstraintTypes)
Shared\Utilities\ExtractTypeHelpers.cs (1)
146foreach (var constraint in typeParameter.ConstraintTypes)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
60var constraints = typeParameter.ConstraintTypes.Where(ts => !ts.IsUnexpressibleTypeParameterConstraint()).ToList(); 66if (constraints.SequenceEqual(typeParameter.ConstraintTypes))
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (6)
64switch (symbol.ConstraintTypes.Length) 74if (symbol.ConstraintTypes.ElementAt(0) is INamedTypeSymbol namedType) 87if (!symbol.ConstraintTypes.All(t => t is INamedTypeSymbol)) 94(INamedTypeSymbol)symbol.ConstraintTypes[0], projects).ConfigureAwait(false); 96for (var i = 1; i < symbol.ConstraintTypes.Length; i++) 99(INamedTypeSymbol)symbol.ConstraintTypes[i], projects).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
319var constraints = typeParameter.ConstraintTypes;
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
182foreach (var constraint in typeParameter.ConstraintTypes)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
270var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2; 271var condition2 = typeParameter.ConstraintTypes.Any(static (ts, allowDelegateAndEnumConstraints) => ts.IsUnexpressibleTypeParameterConstraint(allowDelegateAndEnumConstraints), allowDelegateAndEnumConstraints); 272var condition3 = typeParameter.HasReferenceTypeConstraint && typeParameter.ConstraintTypes.Any(static ts => ts.IsReferenceType && ts.SpecialType != SpecialType.System_Object);
Microsoft.CodeAnalysis.VisualBasic (2)
SymbolDisplay\SymbolDisplayVisitor.Types.vb (1)
533Dim constraintTypes = typeParam.ConstraintTypes
Symbols\TypeParameterSymbol.vb (1)
393Private ReadOnly Property ITypeParameterSymbol_ConstraintTypes As ImmutableArray(Of ITypeSymbol) Implements ITypeParameterSymbol.ConstraintTypes
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\TypeParameterGenerator.vb (1)
42constraints.AddRange(symbol.ConstraintTypes.Select(Function(t) SyntaxFactory.TypeConstraint(t.GenerateTypeSyntax())))
Microsoft.CodeAnalysis.VisualBasic.Features (1)
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
165Dim constraintTypes = typeParam.ConstraintTypes
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\TypeParameterGenerator.vb (1)
42constraints.AddRange(symbol.ConstraintTypes.Select(Function(t) SyntaxFactory.TypeConstraint(t.GenerateTypeSyntax())))
Microsoft.CodeAnalysis.Workspaces (14)
Editing\SyntaxGenerator.cs (2)
876types: tp.ConstraintTypes.Select(TypeExpression)); 885=> typeParameter.HasConstructorConstraint || typeParameter.HasReferenceTypeConstraint || typeParameter.HasValueTypeConstraint || typeParameter.ConstraintTypes.Length > 0;
Recommendations\AbstractRecommendationServiceRunner.cs (3)
417if (!MatchesConstraints(containerType.OriginalDefinition, parameterType.ConstraintTypes)) 461foreach (var constraintType in typeParameterContainer.ConstraintTypes) 486foreach (var constrainedType in typeParameterContainer.ConstraintTypes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
103return symbol.ConstraintTypes.Any(static (ts, self) => ts.Accept(self), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeParameterSymbolExtensions.cs (1)
13=> typeParameter.ConstraintTypes.Select(GetNamedTypeSymbol).WhereNotNull().FirstOrDefault();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (1)
85foreach (var constraint in symbol.ConstraintTypes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
615foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (4)
232if (typeParameter1.ConstraintTypes.Length != typeParameter2.ConstraintTypes.Length) 237return typeParameter1.ConstraintTypes.SetEquals( 238typeParameter2.ConstraintTypes, this.SignatureTypeEquivalenceComparer);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (1)
121typeParameter.ConstraintTypes,
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
FindReferencesTests.cs (1)
516var constraint = comp.GetTypeByMetadataName("C`1").TypeParameters.Single().ConstraintTypes.Single();
Microsoft.VisualStudio.LanguageServices.CSharp (2)
ObjectBrowser\DescriptionBuilder.cs (2)
342if (typeParameterSymbol.ConstraintTypes.Length == 0 && 381foreach (var constraintType in typeParameterSymbol.ConstraintTypes)
Microsoft.VisualStudio.LanguageServices.VisualBasic (5)
ObjectBrowser\DescriptionBuilder.vb (5)
456Debug.Assert(typeParameter.ConstraintTypes.Length = 1) 457AddTypeLink(typeParameter.ConstraintTypes(0), LinkFlags.None) 489If typeParameter.ConstraintTypes.Length > 0 Then 490For Each constraintType In typeParameter.ConstraintTypes 504Dim result = typeParameter.ConstraintTypes.Length