4 implementations of ITypeParameterSymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationTypeParameterSymbol.cs (1)
11internal class CodeGenerationTypeParameterSymbol : CodeGenerationTypeSymbol, ITypeParameterSymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeParameterSymbol.cs (1)
12internal sealed class TypeParameterSymbol : TypeSymbol, ITypeParameterSymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeParameterSymbol.vb (1)
22Implements ITypeParameterSymbol, ITypeParameterSymbolInternal
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationTypeParameterSymbol.cs (1)
11internal class CodeGenerationTypeParameterSymbol : CodeGenerationTypeSymbol, ITypeParameterSymbol
532 references to ITypeParameterSymbol
Microsoft.CodeAnalysis (14)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 836private static ITypeParameterSymbol GetNthTypeParameter(INamedTypeSymbol typeSymbol, int n)
DocumentationCommentId.cs (3)
613public override bool VisitTypeParameter(ITypeParameterSymbol symbol) 640private bool IsInScope(ITypeParameterSymbol typeParameterSymbol) 1368private static ITypeParameterSymbol? GetNthTypeParameter(INamedTypeSymbol typeSymbol, int n)
Symbols\IMethodSymbol.cs (2)
119ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 185ITypeSymbol? GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
Symbols\INamedTypeSymbol.cs (1)
73ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
Symbols\ISymbolExtensions.cs (1)
37var typeParameter = method.TypeParameters[i];
Symbols\ITypeParameterSymbol.cs (2)
93new ITypeParameterSymbol OriginalDefinition { get; } 99ITypeParameterSymbol? ReducedFrom { get; }
Symbols\SymbolVisitor.cs (1)
108public virtual void VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
111public virtual TResult? VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\SymbolVisitor`2.cs (1)
116public virtual TResult VisitTypeParameter(ITypeParameterSymbol symbol, TArgument argument)
Microsoft.CodeAnalysis.CodeStyle (32)
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (3)
110var genericParameterSymbol = GetGenericParameterSymbol(syntaxFacts, semanticModel, arguments[0], arguments[1], cancellationToken); 148private static ITypeParameterSymbol? GetGenericParameterSymbol(ISyntaxFacts syntaxFacts, SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2, CancellationToken cancellationToken) 155return parameterType as ITypeParameterSymbol;
INamedTypeSymbolExtensions.cs (1)
29public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
ISymbolExtensions.cs (4)
365public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 370_ => ImmutableArray<ITypeParameterSymbol>.Empty, 373public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 375var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
96public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
ITypeSymbolExtensions.cs (3)
512var isTypeParameter1 = t1 is ITypeParameterSymbol; 513var isTypeParameter2 = t2 is ITypeParameterSymbol; 605foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes)
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
68public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 836private static ITypeParameterSymbol GetNthTypeParameter(INamedTypeSymbol typeSymbol, int n)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
134SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 600private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 260public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
SymbolKey.cs (1)
63/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
SymbolKey.SymbolKeyWriter.cs (3)
473public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 494var typeParameter = (ITypeParameterSymbol)symbol;
SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
13public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 26var typeParameter = method?.TypeParameters[ordinal];
SymbolKey.TypeParameterSymbolKey.cs (5)
11private sealed class TypeParameterSymbolKey : AbstractSymbolKey<ITypeParameterSymbol> 15public sealed override void Create(ITypeParameterSymbol symbol, SymbolKeyWriter visitor) 31SymbolKeyReader reader, ITypeParameterSymbol? contextualSymbol, out string? failureReason) 60using var result = PooledArrayBuilder<ITypeParameterSymbol>.GetInstance(); 63foreach (var typeParam in containingSymbol.GetTypeParameters())
Microsoft.CodeAnalysis.CodeStyle.Fixes (34)
CodeGenerationAbstractMethodSymbol.cs (2)
48public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 55public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
CodeGenerationAbstractNamedTypeSymbol.cs (1)
102public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
CodeGenerationConstructedMethodSymbol.cs (2)
58public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters; 84public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
CodeGenerationConstructedNamedTypeSymbol.cs (1)
103public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters;
CodeGenerationConstructorSymbol.cs (1)
33typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationConversionSymbol.cs (1)
39typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationDestructorSymbol.cs (1)
24typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationMethodSymbol.cs (3)
22public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 36ImmutableArray<ITypeParameterSymbol> typeParameters, 114public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
CodeGenerationNamedTypeSymbol.cs (3)
23private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 36ImmutableArray<ITypeParameterSymbol> typeParameters, 144public override ImmutableArray<ITypeParameterSymbol> TypeParameters
CodeGenerationOperatorSymbol.cs (1)
38typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationSymbolFactory.cs (7)
160ImmutableArray<ITypeParameterSymbol> typeParameters, 181string name, ImmutableArray<ITypeParameterSymbol> typeParameters, 319public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 331public static ITypeParameterSymbol CreateTypeParameter( 421ImmutableArray<ITypeParameterSymbol> typeParameters = default, 440ImmutableArray<ITypeParameterSymbol> typeParameters = default, 468ImmutableArray<ITypeParameterSymbol> typeParameters = default,
CodeGenerationTypeParameterSymbol.cs (2)
55public new ITypeParameterSymbol OriginalDefinition => this; 57public ITypeParameterSymbol ReducedFrom => null;
ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (3)
18private readonly IList<ITypeParameterSymbol> _typeParameters; 21IList<ITypeParameterSymbol> typeParameters, 81public override void VisitTypeParameter(ITypeParameterSymbol symbol)
ITypeSymbolExtensions.cs (6)
11public static IList<ITypeParameterSymbol> GetReferencedMethodTypeParameters( 12this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 14result ??= new List<ITypeParameterSymbol>(); 19public static IList<ITypeParameterSymbol> GetReferencedTypeParameters( 20this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 22result ??= new List<ITypeParameterSymbol>();
Microsoft.CodeAnalysis.CSharp (37)
Compilation\CSharpSemanticModel.cs (1)
3244public abstract ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken));
Compilation\MemberSemanticModel.cs (1)
881public override ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
371public override ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (1)
2126public override ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
CSharpExtensions.cs (1)
1548public static ITypeParameterSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
SymbolDisplay\SymbolDisplayVisitor.Types.cs (7)
160public override void VisitTypeParameter(ITypeParameterSymbol symbol) 755private void AddTypeParameterVarianceIfNeeded(ITypeParameterSymbol symbol) 807var typeParam = (ITypeParameterSymbol)typeArg; 830private static bool TypeParameterHasConstraints(ITypeParameterSymbol typeParam) 845var typeParam = (ITypeParameterSymbol)typeArg;
Symbols\PublicModel\MethodSymbol.cs (2)
116ImmutableArray<ITypeParameterSymbol> IMethodSymbol.TypeParameters 195ITypeSymbol IMethodSymbol.GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
Symbols\PublicModel\NamedTypeSymbol.cs (1)
64ImmutableArray<ITypeParameterSymbol> INamedTypeSymbol.TypeParameters
Symbols\PublicModel\TypeParameterSymbol.cs (17)
35CodeAnalysis.NullableAnnotation ITypeParameterSymbol.ReferenceTypeConstraintNullableAnnotation => 44TypeParameterKind ITypeParameterSymbol.TypeParameterKind 52IMethodSymbol ITypeParameterSymbol.DeclaringMethod 57INamedTypeSymbol ITypeParameterSymbol.DeclaringType 62ImmutableArray<ITypeSymbol> ITypeParameterSymbol.ConstraintTypes 70ImmutableArray<CodeAnalysis.NullableAnnotation> ITypeParameterSymbol.ConstraintNullableAnnotations => 73ITypeParameterSymbol ITypeParameterSymbol.OriginalDefinition 78ITypeParameterSymbol ITypeParameterSymbol.ReducedFrom 83int ITypeParameterSymbol.Ordinal => _underlying.Ordinal; 85VarianceKind ITypeParameterSymbol.Variance => _underlying.Variance; 87bool ITypeParameterSymbol.HasReferenceTypeConstraint => _underlying.HasReferenceTypeConstraint; 89bool ITypeParameterSymbol.HasValueTypeConstraint => _underlying.HasValueTypeConstraint; 91bool ITypeParameterSymbol.HasUnmanagedTypeConstraint => _underlying.HasUnmanagedTypeConstraint; 93bool ITypeParameterSymbol.HasNotNullConstraint => _underlying.HasNotNullConstraint; 95bool ITypeParameterSymbol.HasConstructorConstraint => _underlying.HasConstructorConstraint;
Symbols\SymbolExtensions.cs (5)
426internal static TypeParameterSymbol? EnsureCSharpSymbolOrNull(this ITypeParameterSymbol? symbol, string paramName) 653internal static ITypeParameterSymbol? GetPublicSymbol(this TypeParameterSymbol? symbol) 655return symbol.GetPublicSymbol<ITypeParameterSymbol>(); 728internal static ImmutableArray<ITypeParameterSymbol> GetPublicSymbols(this ImmutableArray<TypeParameterSymbol> symbols) 730return GetPublicSymbols<ITypeParameterSymbol>(StaticCast<Symbol>.From(symbols));
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
150instance is { Type: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
82if (expressionType is ITypeParameterSymbol typeParameter &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
CSharpTypeInferenceService.TypeInferrer.cs (6)
636IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 658private Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 660var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 665private void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 676var returnTypeParameter = (ITypeParameterSymbol)returnType;
ITypeParameterSymbolExtensions.cs (4)
16this ImmutableArray<ITypeParameterSymbol> typeParameters) 22this IEnumerable<ITypeParameterSymbol> typeParameters) 26foreach (var typeParameter in typeParameters) 36ITypeParameterSymbol typeParameter)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
355public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol)
MethodGenerator.cs (1)
226foreach (var typeParameter in method.TypeParameters)
TypeParameterGenerator.cs (2)
17ImmutableArray<ITypeParameterSymbol> typeParameters, CSharpCodeGenerationContextInfo info) 25private static TypeParameterSyntax GenerateTypeParameter(ITypeParameterSymbol symbol, CSharpCodeGenerationContextInfo info)
Microsoft.CodeAnalysis.CSharp.Features (27)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (5)
108var typeParameters = new List<ITypeParameterSymbol>(); 291private static void AddCapturedTypeParameters(ISymbol symbol, List<ITypeParameterSymbol> typeParameters) 306List<ITypeParameterSymbol> typeParameters, 307IEnumerable<ITypeParameterSymbol> reservedTypeParameters) 313if (symbol != null && symbol.OriginalDefinition is ITypeParameterSymbol typeParameter)
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
150instance is { Type: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
82if (expressionType is ITypeParameterSymbol typeParameter &&
ExtractMethod\CSharpMethodExtractor.cs (1)
191foreach (var typeParameter in TypeParameterCollector.Collect(type))
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
199foreach (var methodTypeParameter in AnalyzerResult.MethodTypeParametersInDeclaration)
GenerateMember\GenerateParameterizedMember\CSharpGenerateConversionService.cs (1)
218typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
GenerateMember\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (10)
58protected override ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken) 60var result = new List<ITypeParameterSymbol>(); 71protected override ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken) 84var typeParameter = GetUniqueTypeParameter( 93using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var list); 98var typeParameter = GetUniqueTypeParameter( 112private ITypeParameterSymbol GetUniqueTypeParameter( 117var methodTypeParameter = GetMethodTypeParameter(type, cancellationToken); 121private ITypeParameterSymbol GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 126if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
GenerateType\CSharpGenerateTypeService.cs (4)
74var typeParameter = parameterIndex < type.TypeParameters.Length ? type.TypeParameters[parameterIndex] : null; 81var typeParameter = parameterIndex < method.TypeParameters.Length ? method.TypeParameters[parameterIndex] : null; 492protected override ImmutableArray<ITypeParameterSymbol> GetTypeParameters( 506return ImmutableArray<ITypeParameterSymbol>.Empty;
SignatureHelp\GenericNameSignatureHelpProvider.cs (3)
212ITypeParameterSymbol parameter, 226ITypeParameterSymbol typeParam, 293private static bool TypeParameterHasConstraints(ITypeParameterSymbol typeParam)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\LambdaTests.cs (1)
5601var expectedType = comp.GetMember<MethodSymbol>("Program.F").TypeParameters.Single().GetPublicSymbol();
Semantics\LocalFunctionTests.cs (1)
5033var symbol = model.GetDeclaredSymbol(typeParameter);
Semantics\LockTests.cs (1)
550var parameterSymbol = model.GetDeclaredSymbol(localDecl);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (33)
Compilation\GetSemanticInfoTests.cs (3)
2093ITypeParameterSymbol typeParameter; 2204private IEnumerable<ISymbol> LookupTypeParameterMembers(string types, string constraints, string memberName, out ITypeParameterSymbol typeParameter) 6046var symbol = model.GetDeclaredSymbol(typeParameters[typeParameters.Length - 1]);
Compilation\SemanticModelAPITests.cs (4)
618var at = a.TypeParameters.First(); 620var bt = b.TypeParameters.First(); 1009var sym1 = model1.GetDeclaredSymbol(para1); 1010var sym2 = model2.GetDeclaredSymbol(para2);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (8)
884var symbol = model.GetDeclaredSymbol(typeDecl.TypeParameterList.Parameters[0]); 904var symbol = model.GetDeclaredSymbol(methodDecl.TypeParameterList.Parameters[0]); 969var ptsym = model.GetDeclaredSymbol(pt); 1484var symbol = LookupTypeParameterFromConstraintClause(model, interfaceDecl.ConstraintClauses[0], "T"); 1533var symbol = LookupTypeParameterFromConstraintClause(model, interfaceDecl.ConstraintClauses[0], "T1"); 1556private static ITypeParameterSymbol LookupTypeParameterFromConstraintClause(SemanticModel model, TypeParameterConstraintClauseSyntax constraintSyntax, string name) 1561var symbol = symbols[0] as ITypeParameterSymbol;
Compilation\SymbolVisitorTests.cs (3)
174public override void VisitTypeParameter(ITypeParameterSymbol symbol) 361public override string VisitTypeParameter(ITypeParameterSymbol symbol) 511public override int VisitTypeParameter(ITypeParameterSymbol symbol, StringBuilder argument)
DocumentationComments\CrefTests.cs (9)
3009ITypeParameterSymbol actualJ; 3014actualJ = (ITypeParameterSymbol)actualTypeA.TypeArguments.Single(); 3022ITypeParameterSymbol actualK; 3026actualK = (ITypeParameterSymbol)actualTypeB.TypeArguments.Single(); 3037ITypeParameterSymbol actualL; 3041actualL = (ITypeParameterSymbol)actualMethod.TypeArguments.Single(); 5566var sourceTypeParam = referencedType.TypeParameters.Single(); 6676var typeParameter = (ITypeParameterSymbol)model.GetSymbolInfo(name).Symbol;
DocumentationComments\ParameterTests.cs (1)
746var expectedTypeParameter = method.TypeParameters.Single();
Symbols\Source\DeclaringSyntaxNodeTests.cs (3)
461foreach (ITypeParameterSymbol tp in ((INamedTypeSymbol)f.Type).TypeParameters) 469foreach (ITypeParameterSymbol tp in m.TypeParameters) 477foreach (ITypeParameterSymbol tp in ((INamedTypeSymbol)f.Type).TypeParameters)
Symbols\Source\NullablePublicAPITests.cs (2)
823ITypeParameterSymbol typeParameterSymbol = ((INamedTypeSymbol)((INamedTypeSymbol)method.ReturnType).GetMembers("B").Single()).TypeParameters.Single(); 4184var typeParameters = localFunctionSymbol.TypeParameters[0];
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CompilationTestUtils.cs (3)
82internal static void CheckConstraints(ITypeParameterSymbol symbol, TypeParameterConstraintKind constraints, params string[] constraintTypes) 163foreach (var typeParameter in method.TypeParameters) 169internal static TypeParameterConstraintKind GetTypeParameterConstraints(ITypeParameterSymbol typeParameter)
Extensions.cs (1)
654public static ImmutableArray<INamedTypeSymbol> AllEffectiveInterfacesNoUseSiteDiagnostics(this ITypeParameterSymbol symbol)
Microsoft.CodeAnalysis.CSharp.Workspaces (15)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1745private protected override SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter)
CSharpTypeInferenceService.TypeInferrer.cs (6)
636IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 658private Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 660var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 665private void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 676var returnTypeParameter = (ITypeParameterSymbol)returnType;
ITypeParameterSymbolExtensions.cs (4)
16this ImmutableArray<ITypeParameterSymbol> typeParameters) 22this IEnumerable<ITypeParameterSymbol> typeParameters) 26foreach (var typeParameter in typeParameters) 36ITypeParameterSymbol typeParameter)
ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
355public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol)
MethodGenerator.cs (1)
226foreach (var typeParameter in method.TypeParameters)
TypeParameterGenerator.cs (2)
17ImmutableArray<ITypeParameterSymbol> typeParameters, CSharpCodeGenerationContextInfo info) 25private static TypeParameterSyntax GenerateTypeParameter(ITypeParameterSymbol symbol, CSharpCodeGenerationContextInfo info)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (3)
145ImmutableArray<ITypeParameterSymbol> typeParameters = default, 351ImmutableArray<ITypeParameterSymbol> typeParameters = default, 519ImmutableArray<ITypeParameterSymbol> typeParameters = default,
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (5)
AbstractTypeParameterChecker.cs (5)
15/// Shared <see cref="SymbolVisitor"/> that looks for instances of <see cref="ITypeParameterSymbol"/> 20private readonly HashSet<ITypeParameterSymbol> _acceptableTypeParameters; 22protected AbstractTypeParameterChecker(ImmutableArray<ITypeParameterSymbol> acceptableTypeParameters) 24_acceptableTypeParameters = new HashSet<ITypeParameterSymbol>(acceptableTypeParameters); 29public sealed override void VisitTypeParameter(ITypeParameterSymbol symbol)
Microsoft.CodeAnalysis.Features (137)
AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (3)
110var genericParameterSymbol = GetGenericParameterSymbol(syntaxFacts, semanticModel, arguments[0], arguments[1], cancellationToken); 148private static ITypeParameterSymbol? GetGenericParameterSymbol(ISyntaxFacts syntaxFacts, SemanticModel semanticModel, SyntaxNode node1, SyntaxNode node2, CancellationToken cancellationToken) 155return parameterType as ITypeParameterSymbol;
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
93if (type is ITypeParameterSymbol typeParameter && !typeParameter.HasConstructorConstraint)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
36if (type is ITypeParameterSymbol typeParameterSymbol)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
491if (receiverTypeSymbol is ITypeParameterSymbol typeParameter)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
315string className, bool isRecord, ImmutableArray<ITypeParameterSymbol> capturedTypeParameters, ImmutableArray<ISymbol> members)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (10)
124ImmutableArray<ITypeParameterSymbol> capturedTypeParameters, 320string structName, ImmutableArray<ITypeParameterSymbol> typeParameters, 397ImmutableArray<ITypeParameterSymbol> typeParameters, bool addRenameAnnotation) 608string structName, ImmutableArray<ITypeParameterSymbol> typeParameters, 628string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 682SyntaxEditor editor, string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 742string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 772SyntaxEditor editor, string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 791Document document, Scope scope, bool isRecord, string structName, ImmutableArray<ITypeParameterSymbol> typeParameters, 903ImmutableArray<ITypeParameterSymbol> typeParameters, ImmutableArray<ISymbol> members)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (11)
2325protected static bool TypeParameterConstraintsEquivalent(ITypeParameterSymbol oldParameter, ITypeParameterSymbol newParameter, bool exact) 2334protected static bool TypeParametersEquivalent(ImmutableArray<ITypeParameterSymbol> oldParameters, ImmutableArray<ITypeParameterSymbol> newParameters, bool exact) 2910else if (newSymbol is ITypeParameterSymbol) 3122if (newSymbol is INamedTypeSymbol or IFieldSymbol or IParameterSymbol or ITypeParameterSymbol) 3963else if (oldSymbol is ITypeParameterSymbol oldTypeParameter && newSymbol is ITypeParameterSymbol newTypeParameter) 4066private static void AnalyzeTypeParameter(ITypeParameterSymbol oldParameter, ITypeParameterSymbol newParameter, ref RudeEditKind rudeEdit, ref bool hasGeneratedAttributeChange) 4264else if (newSymbol is ITypeParameterSymbol)
ExtractMethod\MethodExtractor.Analyzer.cs (29)
129var sortedMap = new SortedDictionary<int, ITypeParameterSymbol>(); 708private static void AddTypeParametersToMap(IEnumerable<ITypeParameterSymbol> typeParameters, IDictionary<int, ITypeParameterSymbol> sortedMap) 710foreach (var typeParameter in typeParameters) 716private static void AddTypeParameterToMap(ITypeParameterSymbol typeParameter, IDictionary<int, ITypeParameterSymbol> sortedMap) 731IDictionary<int, ITypeParameterSymbol> sortedMap) 756private static void AppendMethodTypeParameterFromConstraint(SortedDictionary<int, ITypeParameterSymbol> sortedMap) 758var typeParametersInConstraint = new List<ITypeParameterSymbol>(); 761foreach (var typeParameter in sortedMap.Values) 777foreach (var typeParameter in typeParametersInConstraint) 783private static void AppendMethodTypeParameterUsedDirectly(IDictionary<ISymbol, List<SyntaxToken>> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap) 787var typeParameter = (ITypeParameterSymbol)pair.Key; 798private IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInConstraintList( 802SortedDictionary<int, ITypeParameterSymbol> sortedMap) 814private void AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(SortedDictionary<int, ITypeParameterSymbol> sortedMap) 817var candidates = SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>(); 820foreach (var typeParameter in sortedMap.Values) 835foreach (var typeParameter in candidates) 841private IEnumerable<ITypeParameterSymbol> AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints( 846return SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>(); 853return SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>(); 858return SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>(); 866var typeParameters = new List<ITypeParameterSymbol>(); 869var parameter = parameters[i]; 871if (arguments[i] is ITypeParameterSymbol argument) 897private static IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInDeclaration(ITypeSymbol returnType, SortedDictionary<int, ITypeParameterSymbol> sortedMap)
ExtractMethod\MethodExtractor.AnalyzerResult.cs (8)
20private readonly IList<ITypeParameterSymbol> _typeParametersInDeclaration; 21private readonly IList<ITypeParameterSymbol> _typeParametersInConstraintList; 27IEnumerable<ITypeParameterSymbol> typeParametersInDeclaration, 28IEnumerable<ITypeParameterSymbol> typeParametersInConstraintList, 107public ReadOnlyCollection<ITypeParameterSymbol> MethodTypeParametersInDeclaration 111return new ReadOnlyCollection<ITypeParameterSymbol>(_typeParametersInDeclaration); 115public ReadOnlyCollection<ITypeParameterSymbol> MethodTypeParametersInConstraintList 119return new ReadOnlyCollection<ITypeParameterSymbol>(_typeParametersInConstraintList);
ExtractMethod\MethodExtractor.CodeGenerator.cs (5)
319protected ImmutableArray<ITypeParameterSymbol> CreateMethodTypeParameters() 323return ImmutableArray<ITypeParameterSymbol>.Empty; 326var set = new HashSet<ITypeParameterSymbol>(AnalyzerResult.MethodTypeParametersInConstraintList); 328var typeParameters = ArrayBuilder<ITypeParameterSymbol>.GetInstance(); 329foreach (var parameter in AnalyzerResult.MethodTypeParametersInDeclaration)
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (3)
17private readonly List<ITypeParameterSymbol> _typeParameters = new(); 19public static IEnumerable<ITypeParameterSymbol> Collect(ITypeSymbol typeSymbol) 57public override void VisitTypeParameter(ITypeParameterSymbol typeParameterTypeSymbol)
GenerateMember\AbstractGenerateMemberService.cs (1)
189typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
284private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters)
GenerateMember\GenerateParameterizedMember\AbstractGenerateMethodService.State.cs (1)
259typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (7)
24protected abstract ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken); 25protected abstract ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken); 32protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker( 39private ImmutableArray<ITypeParameterSymbol> ComputeTypeParameters( 48var result = capturedTypeParameters.Except<ITypeParameterSymbol>(availableTypeParameters, SymbolEqualityComparer.Default).ToImmutableArray(); 57private ITypeParameterSymbol MassageTypeParameter( 58ITypeParameterSymbol typeParameter)
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
37protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken)
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (7)
31private ImmutableArray<ITypeParameterSymbol> _typeParameters; 32private IDictionary<ITypeSymbol, ITypeParameterSymbol> _typeArgumentToTypeParameterMap; 42public ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken) 49protected abstract ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken); 163private IDictionary<ITypeSymbol, ITypeParameterSymbol> GetTypeArgumentToTypeParameterMap( 169private IDictionary<ITypeSymbol, ITypeParameterSymbol> CreateTypeArgumentToTypeParameterMap( 179var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
GenerateMember\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
68public override async ValueTask VisitTypeParameter(ITypeParameterSymbol symbol) 94private async ValueTask<ITypeSymbol> DetermineCommonDerivedTypeAsync(ITypeParameterSymbol symbol)
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
483using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var combinedTypeParameters);
GenerateType\AbstractGenerateTypeService.cs (6)
46protected abstract ImmutableArray<ITypeParameterSymbol> GetTypeParameters(State state, SemanticModel semanticModel, CancellationToken cancellationToken); 188protected static ImmutableArray<ITypeParameterSymbol> GetTypeParameters( 196using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameters); 206if (type is ITypeParameterSymbol typeParameter) 266protected IList<ITypeParameterSymbol> GetAvailableTypeParameters( 275: SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>();
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (4)
83private ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWithDelegateChecks() 307private ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters() 319protected IList<ITypeParameterSymbol> GetAvailableTypeParameters() 324: SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>();
ImplementAbstractClass\ImplementAbstractClassData.cs (1)
321current is ITypeParameterSymbol typeParameter)
ImplementInterface\AbstractImplementInterfaceService.AccessibilityHelper.cs (1)
92if (first is ITypeParameterSymbol typeParameter)
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (1)
382ITypeParameterSymbol typeParameter,
IntroduceVariable\AbstractIntroduceVariableService.State_Parameter.cs (1)
28if (bindingMap.AllReferencedSymbols.OfType<ITypeParameterSymbol>()
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
133public override void VisitTypeParameter(ITypeParameterSymbol symbol)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (6)
174if (symbol is IParameterSymbol or ITypeParameterSymbol) 395else if (symbol is ITypeParameterSymbol typeParameter) 550var typeParameter = typeParameters[i]; 551if (typeArgument is ITypeParameterSymbol && typeArgument.Name == typeParameter.Name) 729private void AddDescriptionForTypeParameter(ITypeParameterSymbol symbol) 767List<ITypeParameterSymbol> typeParameters,
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (2)
84public ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 113public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
78public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters;
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
266if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Cref })
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
48foreach (var typeParameter in symbol.TypeParameters)
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
85var typeParameter = symbol.GetTypeParameters().FirstOrDefault(t => syntaxFacts.StringComparer.Equals(t.Name, singleWordText));
Shared\Extensions\ISymbolExtensions_2.cs (1)
189ITypeParameterSymbol typeParam => typeParam.ContainingSymbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken)?.GetTypeParameterText(typeParam.Name),
Shared\Utilities\ExtractTypeHelpers.cs (13)
132public static ImmutableArray<ITypeParameterSymbol> GetRequiredTypeParametersForMembers(INamedTypeSymbol type, IEnumerable<ISymbol> includedMembers) 141var allReferencedTypeParameters = new HashSet<ITypeParameterSymbol>(directlyReferencedTypeParameters); 142var unanalyzedTypeParameters = new Queue<ITypeParameterSymbol>(directlyReferencedTypeParameters); 146var typeParameter = unanalyzedTypeParameters.Dequeue(); 150foreach (var originalTypeParameter in potentialTypeParameters) 165private static ImmutableArray<ITypeParameterSymbol> GetPotentialTypeParameters(INamedTypeSymbol type) 167using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameters); 186private static ImmutableArray<ITypeParameterSymbol> GetDirectlyReferencedTypeParameters(IEnumerable<ITypeParameterSymbol> potentialTypeParameters, IEnumerable<ISymbol> includedMembers) 188using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var directlyReferencedTypeParameters); 189foreach (var typeParameter in potentialTypeParameters) 200private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes) 225private static bool DoesTypeReferenceTypeParameter(ITypeSymbol type, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 836private static ITypeParameterSymbol GetNthTypeParameter(INamedTypeSymbol typeSymbol, int n)
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\TestOperationVisitor.cs (2)
763Assert.IsAssignableFrom<ITypeParameterSymbol>(constrainedToType); 864Assert.IsAssignableFrom<ITypeParameterSymbol>(constrainedToType);
Microsoft.CodeAnalysis.VisualBasic (32)
Binding\MemberSemanticModel.vb (1)
558Public Overloads Overrides Function GetDeclaredSymbol(typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol
Compilation\SemanticModel.vb (1)
2612Public MustOverride Overloads Function GetDeclaredSymbol(typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol
Compilation\SpeculativeSemanticModelWithMemberModel.vb (1)
177Public Overloads Overrides Function GetDeclaredSymbol(typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol
Compilation\SyntaxTreeSemanticModel.vb (1)
1105Public Overloads Overrides Function GetDeclaredSymbol(typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol
SymbolDisplay\SymbolDisplayVisitor.Types.vb (5)
81Public Overrides Sub VisitTypeParameter(symbol As ITypeParameterSymbol) 468Private Sub AddTypeParameterVarianceIfRequired(symbol As ITypeParameterSymbol) 499Dim typeParam = DirectCast(typeArg, ITypeParameterSymbol) 522Private Shared Function TypeParameterSpecialConstraintCount(typeParam As ITypeParameterSymbol) As Integer 528Private Sub AddTypeParameterConstraints(typeParam As ITypeParameterSymbol)
Symbols\MethodSymbol.vb (3)
934Private Function IMethodSymbol_GetTypeInferredDuringReduction(reducedFromTypeParameter As ITypeParameterSymbol) As ITypeSymbol Implements IMethodSymbol.GetTypeInferredDuringReduction 1067Private ReadOnly Property IMethodSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements IMethodSymbol.TypeParameters 1069Return StaticCast(Of ITypeParameterSymbol).From(Me.TypeParameters)
Symbols\NamedTypeSymbol.vb (2)
1158Private ReadOnly Property INamedTypeSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements INamedTypeSymbol.TypeParameters 1160Return StaticCast(Of ITypeParameterSymbol).From(Me.TypeParameters)
Symbols\TypeParameterSymbol.vb (17)
79Public MustOverride ReadOnly Property HasConstructorConstraint As Boolean Implements ITypeParameterSymbol.HasConstructorConstraint 91Public MustOverride ReadOnly Property TypeParameterKind As TypeParameterKind Implements ITypeParameterSymbol.TypeParameterKind 316Public MustOverride ReadOnly Property HasReferenceTypeConstraint As Boolean Implements ITypeParameterSymbol.HasReferenceTypeConstraint 318Public MustOverride ReadOnly Property HasValueTypeConstraint As Boolean Implements ITypeParameterSymbol.HasValueTypeConstraint 320Private ReadOnly Property HasUnmanagedTypeConstraint As Boolean Implements ITypeParameterSymbol.HasUnmanagedTypeConstraint 326Private ReadOnly Property HasNotNullConstraint As Boolean Implements ITypeParameterSymbol.HasNotNullConstraint 332Public MustOverride ReadOnly Property Variance As VarianceKind Implements ITypeParameterSymbol.Variance 367Private ReadOnly Property ITypeParameterSymbol_ReferenceTypeConstraintNullableAnnotation As NullableAnnotation Implements ITypeParameterSymbol.ReferenceTypeConstraintNullableAnnotation 373Private ReadOnly Property ITypeParameterSymbol_DeclaringMethod As IMethodSymbol Implements ITypeParameterSymbol.DeclaringMethod 379Private ReadOnly Property ITypeParameterSymbol_DeclaringType As INamedTypeSymbol Implements ITypeParameterSymbol.DeclaringType 385Private ReadOnly Property ITypeParameterSymbol_Ordinal As Integer Implements ITypeParameterSymbol.Ordinal 391Private ReadOnly Property ITypeParameterSymbol_ConstraintTypes As ImmutableArray(Of ITypeSymbol) Implements ITypeParameterSymbol.ConstraintTypes 397Private ReadOnly Property ITypeParameterSymbol_ConstraintNullableAnnotations As ImmutableArray(Of NullableAnnotation) Implements ITypeParameterSymbol.ConstraintNullableAnnotations 403Private ReadOnly Property ITypeParameterSymbol_OriginalDefinition As ITypeParameterSymbol Implements ITypeParameterSymbol.OriginalDefinition 409Private ReadOnly Property ITypeParameterSymbol_ReducedFrom As ITypeParameterSymbol Implements ITypeParameterSymbol.ReducedFrom
VisualBasicExtensions.vb (1)
1058Public Function GetDeclaredSymbol(semanticModel As SemanticModel, typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
TypeSyntaxGeneratorVisitor.vb (1)
202Public Overrides Function VisitTypeParameter(symbol As ITypeParameterSymbol) As TypeSyntax
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler (1)
TypeParameterChecker.vb (1)
26MyBase.New(acceptableTypeParameters.As(Of ITypeParameterSymbol))
Microsoft.CodeAnalysis.VisualBasic.Features (15)
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
158typeParameters:=ImmutableArray(Of ITypeParameterSymbol).Empty,
GenerateMember\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (9)
64Protected Overrides Function GetCapturedTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 65Dim result = New List(Of ITypeParameterSymbol)() 76Protected Overrides Function GenerateTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 95Dim list = ArrayBuilder(Of ITypeParameterSymbol).GetInstance() 111cancellationToken As CancellationToken) As ITypeParameterSymbol 119Private Function GetMethodTypeParameter(type As TypeSyntax, cancellationToken As CancellationToken) As ITypeParameterSymbol 122If TypeOf info.Type Is ITypeParameterSymbol AndAlso 123DirectCast(info.Type, ITypeParameterSymbol).TypeParameterKind = TypeParameterKind.Method Then 124Return DirectCast(info.Type, ITypeParameterSymbol)
GenerateType\VisualBasicGenerateTypeService.vb (2)
377cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 386Return ImmutableArray(Of ITypeParameterSymbol).Empty
SignatureHelp\GenericNameSignatureHelpProvider.vb (3)
149Private Overloads Shared Function Convert(parameter As ITypeParameterSymbol, semanticModel As SemanticModel, position As Integer, documentationCommentFormattingService As IDocumentationCommentFormattingService) As SignatureHelpSymbolParameter 161Private Shared Function AddConstraints(typeParam As ITypeParameterSymbol, 213Private Shared Function TypeParameterSpecialConstraintCount(typeParam As ITypeParameterSymbol) As Integer
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
1784ByRef syntax As TypeParameterSyntax) As ITypeParameterSymbol
Semantics\GetSemanticInfoTests.vb (1)
4425ByRef syntax As TypeParameterSyntax) As ITypeParameterSymbol
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeGeneration\TypeParameterGenerator.vb (3)
10Public Shared Function GenerateTypeParameterList(typeParameters As ImmutableArray(Of ITypeParameterSymbol)) As TypeParameterListSyntax 16Private Shared Function GenerateTypeParameter(symbol As ITypeParameterSymbol) As TypeParameterSyntax 23Private Shared Function GenerateTypeParameterConstraintClause(symbol As ITypeParameterSymbol) As TypeParameterConstraintClauseSyntax
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
2783Private Protected Overrides Function TypeParameter(symbol As ITypeParameterSymbol) As SyntaxNode
TypeSyntaxGeneratorVisitor.vb (1)
202Public Overrides Function VisitTypeParameter(symbol As ITypeParameterSymbol) As TypeSyntax
Microsoft.CodeAnalysis.Workspaces (98)
CodeGenerationAbstractMethodSymbol.cs (2)
48public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 55public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
CodeGenerationAbstractNamedTypeSymbol.cs (1)
102public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
CodeGenerationConstructedMethodSymbol.cs (2)
58public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters; 84public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
CodeGenerationConstructedNamedTypeSymbol.cs (1)
103public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters;
CodeGenerationConstructorSymbol.cs (1)
33typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationConversionSymbol.cs (1)
39typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationDestructorSymbol.cs (1)
24typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationMethodSymbol.cs (3)
22public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 36ImmutableArray<ITypeParameterSymbol> typeParameters, 114public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
CodeGenerationNamedTypeSymbol.cs (3)
23private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 36ImmutableArray<ITypeParameterSymbol> typeParameters, 144public override ImmutableArray<ITypeParameterSymbol> TypeParameters
CodeGenerationOperatorSymbol.cs (1)
38typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
CodeGenerationSymbolFactory.cs (7)
160ImmutableArray<ITypeParameterSymbol> typeParameters, 181string name, ImmutableArray<ITypeParameterSymbol> typeParameters, 319public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 331public static ITypeParameterSymbol CreateTypeParameter( 421ImmutableArray<ITypeParameterSymbol> typeParameters = default, 440ImmutableArray<ITypeParameterSymbol> typeParameters = default, 468ImmutableArray<ITypeParameterSymbol> typeParameters = default,
CodeGenerationTypeParameterSymbol.cs (2)
55public new ITypeParameterSymbol OriginalDefinition => this; 57public ITypeParameterSymbol ReducedFrom => null;
Editing\SyntaxGenerator.cs (8)
198foreach (var typeParameter in method.TypeParameters) 231bool HasNullableAnnotation(ITypeParameterSymbol typeParameter, IMethodSymbol method) 237static bool IsNullableAnnotatedTypeParameter(ITypeParameterSymbol typeParameter, ITypeParameterSymbol current) 346private protected abstract SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter); 872private SyntaxNode WithTypeParametersAndConstraints(SyntaxNode declaration, ImmutableArray<ITypeParameterSymbol> typeParameters) 878foreach (var tp in typeParameters) 894private static bool HasSomeConstraint(ITypeParameterSymbol typeParameter)
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (2)
15internal abstract class AbstractTypeParameterSymbolReferenceFinder : AbstractReferenceFinder<ITypeParameterSymbol> 18ITypeParameterSymbol symbol,
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
31public override INamedTypeSymbol? VisitTypeParameter(ITypeParameterSymbol symbol)
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (3)
15protected override bool CanFind(ITypeParameterSymbol symbol) 19ITypeParameterSymbol symbol, 40ITypeParameterSymbol symbol,
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (2)
14protected override bool CanFind(ITypeParameterSymbol symbol) 18ITypeParameterSymbol symbol,
ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
96public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (3)
18private readonly IList<ITypeParameterSymbol> _typeParameters; 21IList<ITypeParameterSymbol> typeParameters, 81public override void VisitTypeParameter(ITypeParameterSymbol symbol)
ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
68public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
29public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (4)
365public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 370_ => ImmutableArray<ITypeParameterSymbol>.Empty, 373public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 375var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (3)
512var isTypeParameter1 = t1 is ITypeParameterSymbol; 513var isTypeParameter2 = t2 is ITypeParameterSymbol; 605foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes)
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (6)
11public static IList<ITypeParameterSymbol> GetReferencedMethodTypeParameters( 12this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 14result ??= new List<ITypeParameterSymbol>(); 19public static IList<ITypeParameterSymbol> GetReferencedTypeParameters( 20this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 22result ??= new List<ITypeParameterSymbol>();
Recommendations\AbstractRecommendationService.cs (1)
107return ((ITypeParameterSymbol)symbol).TypeParameterKind != TypeParameterKind.Cref;
Recommendations\AbstractRecommendationServiceRunner.cs (3)
152if (parameterTypeSymbol.IsKind<ITypeParameterSymbol>(SymbolKind.TypeParameter, out var typeParameter)) 368if (originalMember is IMethodSymbol { Parameters: [{ Type: ITypeParameterSymbol parameterType }, ..] })
Shared\Extensions\IMethodSymbolExtensions.cs (4)
114private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 115ImmutableArray<ITypeParameterSymbol> typeParameters, 126var typeParameter = typeParameters[i]; 152return newTypeParameters.Cast<ITypeParameterSymbol>().ToImmutableArray();
Shared\Extensions\ITypeParameterSymbolExtensions.cs (3)
12public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 19: type is ITypeParameterSymbol 20? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
Shared\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Extensions\ITypeSymbolExtensions.cs (1)
184IEnumerable<ITypeParameterSymbol> availableTypeParameters)
Shared\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
47public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
71public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
71public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Shared\Utilities\SignatureComparer.cs (4)
212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i]; 222private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
134SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 600private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 260public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
SymbolKey.cs (1)
63/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
SymbolKey.SymbolKeyWriter.cs (3)
473public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 494var typeParameter = (ITypeParameterSymbol)symbol;
SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
13public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 26var typeParameter = method?.TypeParameters[ordinal];
SymbolKey.TypeParameterSymbolKey.cs (5)
11private sealed class TypeParameterSymbolKey : AbstractSymbolKey<ITypeParameterSymbol> 15public sealed override void Create(ITypeParameterSymbol symbol, SymbolKeyWriter visitor) 31SymbolKeyReader reader, ITypeParameterSymbol? contextualSymbol, out string? failureReason) 60using var result = PooledArrayBuilder<ITypeParameterSymbol>.GetInstance(); 63foreach (var typeParam in containingSymbol.GetTypeParameters())
Workspace\Solution\SolutionState.SymbolToProjectId.cs (1)
132else if (symbol.IsKind(SymbolKind.TypeParameter, out ITypeParameterSymbol? typeParameter) &&
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SymbolKeyTests.cs (2)
755var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Where(n => !n.IsImplicitlyDeclared).Single().TypeParameters.Single(); 768var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>()
Microsoft.VisualStudio.LanguageServices (6)
ChangeSignature\AddParameterDialogViewModel.cs (1)
239if (typeArgument is ITypeParameterSymbol)
Progression\GraphNodeIdCreation.cs (5)
81var typeParameter = (ITypeParameterSymbol)symbol; 98items.Add(GraphNodeId.GetPartial(CodeGraphNodeIdName.Parameter, ((ITypeParameterSymbol)symbol).Ordinal.ToString())); 136else if (symbol is ITypeParameterSymbol typeParameter) 256private static async Task<GraphNodeId> GetPartialForTypeParameterSymbolAsync(ITypeParameterSymbol typeParameterSymbol, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
ObjectBrowser\DescriptionBuilder.cs (3)
326foreach (var typeParameterSymbol in typeSymbol.TypeParameters) 334foreach (var typeParameterSymbol in methodSymbol.TypeParameters) 340private void BuildConstraints(ITypeParameterSymbol typeParameterSymbol)
Microsoft.VisualStudio.LanguageServices.VisualBasic (5)
ObjectBrowser\DescriptionBuilder.vb (5)
415Private Sub BuildTypeParameterList(typeParameters As ImmutableArray(Of ITypeParameterSymbol)) 433Private Sub AddConstraints(typeParameter As ITypeParameterSymbol) 446Private Sub AddSingleConstraint(typeParameter As ITypeParameterSymbol) 461Private Sub AddMultipleConstraints(typeParameter As ITypeParameterSymbol) 503Private Shared Function CountConstraints(typeParameter As ITypeParameterSymbol) As Integer