2 implementations of 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
616 references to ITypeParameterSymbol
ILLink.RoslynAnalyzer (16)
DynamicallyAccessedMembersAnalyzer.cs (1)
231 var attributableSymbol = attributableMethod.TypeParameters[i];
RequiresAnalyzerBase.cs (2)
70 var typeParams = ImmutableArray<ITypeParameterSymbol>.Empty; 88 var typeParam = typeParams[i];
TrimAnalysis\GenericArgumentDataFlow.cs (3)
38 ImmutableArray<ITypeParameterSymbol> typeParameters, 98 static bool RequiresGenericArgumentDataFlow (ImmutableArray<ITypeParameterSymbol> typeParameters) 100 foreach (var typeParameter in typeParameters) {
TrimAnalysis\GenericParameterProxy.cs (2)
10 public GenericParameterProxy (ITypeParameterSymbol typeParameterSymbol) => TypeParameterSymbol = typeParameterSymbol; 27 public readonly ITypeParameterSymbol TypeParameterSymbol;
TrimAnalysis\GenericParameterValue.cs (2)
18 public GenericParameterValue (ITypeParameterSymbol typeParameterSymbol, DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes) 24 public GenericParameterValue (ITypeParameterSymbol typeParameterSymbol)
TrimAnalysis\HandleCallAction.cs (2)
91 if (staticType is null || staticTypeDef is null || staticType is ITypeParameterSymbol) { 93 if (staticType is ITypeParameterSymbol genericParam) {
TrimAnalysis\MethodProxy.cs (1)
42 foreach (var typeParameter in Method.TypeParameters) {
TrimAnalysis\SingleValueExtensions.cs (2)
21 new GenericParameterValue ((ITypeParameterSymbol) underlyingType)), 30 SymbolKind.TypeParameter => new GenericParameterValue ((ITypeParameterSymbol) type),
TrimAnalysis\TypeProxy.cs (1)
21 foreach (var typeParameter in namedType.TypeParameters) {
Microsoft.Analyzers.Extra (1)
ConditionalAccessAnalyzer.cs (1)
85if (type is ITypeParameterSymbol tp)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (3)
14if (response.ResponseType is ITypeParameterSymbol) 33if (typeSymbol is ITypeParameterSymbol || 35((INamedTypeSymbol)typeSymbol).TypeArguments.Any(a => a is 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)
650public override bool VisitTypeParameter(ITypeParameterSymbol symbol) 682private bool IsInScope(ITypeParameterSymbol typeParameterSymbol) 1410private 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)
39var typeParameter = method.TypeParameters[i];
Symbols\ITypeParameterSymbol.cs (2)
98new ITypeParameterSymbol OriginalDefinition { get; } 104ITypeParameterSymbol? 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 (50)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
263useSpread = method.GetOriginalUnreducedDefinition() is not IMethodSymbol { IsExtensionMethod: true, Parameters: [_, { Type: ITypeParameterSymbol }] };
src\Analyzers\Core\Analyzers\UseIsNullCheck\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;
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 836private static ITypeParameterSymbol GetNthTypeParameter(INamedTypeSymbol typeSymbol, int n)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
30public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (3)
417public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 425public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 427var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
96public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeParameterSymbolExtensions.cs (3)
12public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 19: type is ITypeParameterSymbol 20? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
64public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15IList<ITypeParameterSymbol> typeParameters, 73public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (8)
522var isTypeParameter1 = t1 is ITypeParameterSymbol; 523var isTypeParameter2 = t2 is ITypeParameterSymbol; 615foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 770IEnumerable<ITypeParameterSymbol> availableTypeParameters) 799public static IList<ITypeParameterSymbol> GetReferencedMethodTypeParameters( 800this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 807public static IList<ITypeParameterSymbol> GetReferencedTypeParameters( 808this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
68public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
47public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
62public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
66public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
63/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
479public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 500var typeParameter = (ITypeParameterSymbol)symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
13public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 26var typeParameter = method?.TypeParameters[ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\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())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (4)
212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i]; 222private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
132SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 615private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
73SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 259public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Microsoft.CodeAnalysis.CodeStyle.Fixes (53)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
289private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
189typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter
src\Analyzers\Core\CodeFixes\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)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
30protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (7)
39private ImmutableArray<ITypeParameterSymbol> _typeParameters; 40private IDictionary<ITypeSymbol, ITypeParameterSymbol> _typeArgumentToTypeParameterMap; 42public ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken) 49protected abstract ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken); 167private IDictionary<ITypeSymbol, ITypeParameterSymbol> GetTypeArgumentToTypeParameterMap( 173private IDictionary<ITypeSymbol, ITypeParameterSymbol> CreateTypeArgumentToTypeParameterMap( 183var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
59public override async ValueTask VisitTypeParameter(ITypeParameterSymbol symbol) 85private async ValueTask<ITypeSymbol> DetermineCommonDerivedTypeAsync(ITypeParameterSymbol symbol)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
483using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var combinedTypeParameters);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
317current is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
180if (first is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
267ITypeParameterSymbol typeParameter,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
160ImmutableArray<ITypeParameterSymbol> typeParameters, 181string name, ImmutableArray<ITypeParameterSymbol> typeParameters, 319public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 332public static ITypeParameterSymbol CreateTypeParameter( 423ImmutableArray<ITypeParameterSymbol> typeParameters = default, 442ImmutableArray<ITypeParameterSymbol> typeParameters = default, 470ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
48public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 55public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
102public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedMethodSymbol.cs (2)
58public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters; 84public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
103public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (1)
30typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (1)
36typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (1)
21typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (3)
22public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 36ImmutableArray<ITypeParameterSymbol> typeParameters, 114public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
23private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 36ImmutableArray<ITypeParameterSymbol> typeParameters, 144public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (1)
35typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (3)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol 45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
101private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 102ImmutableArray<ITypeParameterSymbol> typeParameters, 113var typeParameter = typeParameters[i]; 140return newTypeParameters.Cast<ITypeParameterSymbol>().ToImmutableArray();
Microsoft.CodeAnalysis.CSharp (39)
Compilation\CSharpSemanticModel.cs (1)
3251public abstract ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken));
Compilation\MemberSemanticModel.cs (1)
891public override ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
375public override ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (1)
2134public override ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
CSharpExtensions.cs (1)
1571public static ITypeParameterSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken))
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
832!(symbol.IsParams && symbol.Type is { IsRefLikeType: true } or ITypeParameterSymbol { AllowsRefLikeType: true }))
SymbolDisplay\SymbolDisplayVisitor.Types.cs (7)
156public override void VisitTypeParameter(ITypeParameterSymbol symbol) 761private void AddTypeParameterVarianceIfNeeded(ITypeParameterSymbol symbol) 813var typeParam = (ITypeParameterSymbol)typeArg; 836private static bool TypeParameterHasConstraints(ITypeParameterSymbol typeParam) 851var typeParam = (ITypeParameterSymbol)typeArg;
Symbols\PublicModel\MethodSymbol.cs (2)
114ImmutableArray<ITypeParameterSymbol> IMethodSymbol.TypeParameters 196ITypeSymbol IMethodSymbol.GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
Symbols\PublicModel\NamedTypeSymbol.cs (1)
64ImmutableArray<ITypeParameterSymbol> INamedTypeSymbol.TypeParameters
Symbols\PublicModel\TypeParameterSymbol.cs (18)
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.AllowsRefLikeType => _underlying.AllowsRefLikeType; 93bool ITypeParameterSymbol.HasUnmanagedTypeConstraint => _underlying.HasUnmanagedTypeConstraint; 95bool ITypeParameterSymbol.HasNotNullConstraint => _underlying.HasNotNullConstraint; 97bool ITypeParameterSymbol.HasConstructorConstraint => _underlying.HasConstructorConstraint;
Symbols\SymbolExtensions.cs (5)
432internal static TypeParameterSymbol? EnsureCSharpSymbolOrNull(this ITypeParameterSymbol? symbol, string paramName) 659internal static ITypeParameterSymbol? GetPublicSymbol(this TypeParameterSymbol? symbol) 661return symbol.GetPublicSymbol<ITypeParameterSymbol>(); 734internal static ImmutableArray<ITypeParameterSymbol> GetPublicSymbols(this ImmutableArray<TypeParameterSymbol> symbols) 736return GetPublicSymbols<ITypeParameterSymbol>(StaticCast<Symbol>.From(symbols));
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
260instance is { Type: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
929TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }] 945if (originalCreateMethod.Parameters.All(static p => p.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method })) 950if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }]) 976TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }]
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
81if (expressionType is ITypeParameterSymbol typeParameter &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (24)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (10)
52protected override ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken) 54var result = new List<ITypeParameterSymbol>(); 65protected override ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken) 78var typeParameter = GetUniqueTypeParameter( 87var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 93var typeParameter = GetUniqueTypeParameter( 107private ITypeParameterSymbol GetUniqueTypeParameter( 112var methodTypeParameter = GetMethodTypeParameter(type, cancellationToken); 116private ITypeParameterSymbol GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 121if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
228foreach (var typeParameter in method.TypeParameters)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\TypeParameterGenerator.cs (2)
19ImmutableArray<ITypeParameterSymbol> typeParameters, CSharpCodeGenerationContextInfo info) 27private static TypeParameterSyntax GenerateTypeParameter(ITypeParameterSymbol symbol, CSharpCodeGenerationContextInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (4)
18this ImmutableArray<ITypeParameterSymbol> typeParameters) 24this IEnumerable<ITypeParameterSymbol> typeParameters) 28foreach (var typeParameter in typeParameters) 38ITypeParameterSymbol typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
360public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (6)
624IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 646private static Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 648var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 653private static void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 664var returnTypeParameter = (ITypeParameterSymbol)returnType;
Microsoft.CodeAnalysis.CSharp.Features (28)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (5)
99var typeParameters = new List<ITypeParameterSymbol>(); 283private static void AddCapturedTypeParameters(ISymbol symbol, List<ITypeParameterSymbol> typeParameters) 298List<ITypeParameterSymbol> typeParameters, 299IEnumerable<ITypeParameterSymbol> reservedTypeParameters) 305if (symbol != null && symbol.OriginalDefinition is ITypeParameterSymbol typeParameter)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1153else if (oldSymbol is ITypeParameterSymbol oldTypeParameter)
GenerateType\CSharpGenerateTypeService.cs (3)
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(
SignatureHelp\GenericNameSignatureHelpProvider.cs (3)
212ITypeParameterSymbol parameter, 226ITypeParameterSymbol typeParam, 309private static bool TypeParameterHasConstraints(ITypeParameterSymbol typeParam)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
260instance is { Type: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
929TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }] 945if (originalCreateMethod.Parameters.All(static p => p.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method })) 950if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }]) 976TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }]
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
81if (expressionType is ITypeParameterSymbol typeParameter &&
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (10)
52protected override ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken) 54var result = new List<ITypeParameterSymbol>(); 65protected override ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken) 78var typeParameter = GetUniqueTypeParameter( 87var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 93var typeParameter = GetUniqueTypeParameter( 107private ITypeParameterSymbol GetUniqueTypeParameter( 112var methodTypeParameter = GetMethodTypeParameter(type, cancellationToken); 116private ITypeParameterSymbol GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 121if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\LocalFunctionTests.cs (1)
5115var symbol = model.GetDeclaredSymbol(typeParameter);
Semantics\LockTests.cs (1)
551var parameterSymbol = model.GetDeclaredSymbol(localDecl);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (35)
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;
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\MethodTests.cs (1)
190var t1 = mylist.TypeParameters[0];
Symbols\Source\NullablePublicAPITests.cs (2)
825ITypeParameterSymbol typeParameterSymbol = ((INamedTypeSymbol)((INamedTypeSymbol)method.ReturnType).GetMembers("B").Single()).TypeParameters.Single(); 4183var typeParameters = localFunctionSymbol.TypeParameters[0];
Symbols\Source\TypeMapTests.cs (2)
56var t = at.TypeParameters[0]; 59var u = atbu.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)
694public static ImmutableArray<INamedTypeSymbol> AllEffectiveInterfacesNoUseSiteDiagnostics(this ITypeParameterSymbol symbol)
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1751private protected override SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
831if (excludeInstance && containerType is ITypeParameterSymbol && symbol.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
228foreach (var typeParameter in method.TypeParameters)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\TypeParameterGenerator.cs (2)
19ImmutableArray<ITypeParameterSymbol> typeParameters, CSharpCodeGenerationContextInfo info) 27private static TypeParameterSyntax GenerateTypeParameter(ITypeParameterSymbol symbol, CSharpCodeGenerationContextInfo info)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (4)
18this ImmutableArray<ITypeParameterSymbol> typeParameters) 24this IEnumerable<ITypeParameterSymbol> typeParameters) 28foreach (var typeParameter in typeParameters) 38ITypeParameterSymbol typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
360public override TypeSyntax VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (6)
624IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 646private static Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 648var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 653private static void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 664var returnTypeParameter = (ITypeParameterSymbol)returnType;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (3)
140ImmutableArray<ITypeParameterSymbol> typeParameters = default, 342ImmutableArray<ITypeParameterSymbol> typeParameters = default, 507ImmutableArray<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 (118)
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
91if (type is ITypeParameterSymbol typeParameter && !typeParameter.HasConstructorConstraint)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
36if (type is ITypeParameterSymbol typeParameterSymbol)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (1)
486if (receiverTypeSymbol is ITypeParameterSymbol typeParameter)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
313string className, bool isRecord, ImmutableArray<ITypeParameterSymbol> capturedTypeParameters, ImmutableArray<ISymbol> members)
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (10)
123ImmutableArray<ITypeParameterSymbol> capturedTypeParameters, 328string structName, ImmutableArray<ITypeParameterSymbol> typeParameters, 405ImmutableArray<ITypeParameterSymbol> typeParameters, bool addRenameAnnotation) 616string structName, ImmutableArray<ITypeParameterSymbol> typeParameters, 636string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 690SyntaxEditor editor, string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 750string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 780SyntaxEditor editor, string typeName, ImmutableArray<ITypeParameterSymbol> typeParameters, 799Document document, Scope scope, bool isRecord, string structName, ImmutableArray<ITypeParameterSymbol> typeParameters, 911ImmutableArray<ITypeParameterSymbol> typeParameters, ImmutableArray<ISymbol> members)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (4)
2408protected static bool TypeParameterConstraintsEquivalent(ITypeParameterSymbol oldParameter, ITypeParameterSymbol newParameter, bool exact) 2418protected static bool TypeParametersEquivalent(ImmutableArray<ITypeParameterSymbol> oldParameters, ImmutableArray<ITypeParameterSymbol> newParameters, bool exact)
ExtractMethod\MethodExtractor.Analyzer.cs (24)
188var sortedMap = new SortedDictionary<int, ITypeParameterSymbol>(); 718private static void AddTypeParametersToMap(IEnumerable<ITypeParameterSymbol> typeParameters, IDictionary<int, ITypeParameterSymbol> sortedMap) 720foreach (var typeParameter in typeParameters) 726private static void AddTypeParameterToMap(ITypeParameterSymbol typeParameter, IDictionary<int, ITypeParameterSymbol> sortedMap) 741IDictionary<int, ITypeParameterSymbol> sortedMap) 766private static void AppendMethodTypeParameterFromConstraint(SortedDictionary<int, ITypeParameterSymbol> sortedMap) 768var typeParametersInConstraint = new List<ITypeParameterSymbol>(); 771foreach (var typeParameter in sortedMap.Values) 787foreach (var typeParameter in typeParametersInConstraint) 793private static void AppendMethodTypeParameterUsedDirectly(IDictionary<ISymbol, List<SyntaxToken>> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap) 797var typeParameter = (ITypeParameterSymbol)pair.Key; 808private IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInConstraintList( 812SortedDictionary<int, ITypeParameterSymbol> sortedMap) 824private static void AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(SortedDictionary<int, ITypeParameterSymbol> sortedMap) 827var candidates = SpecializedCollections.EmptyEnumerable<ITypeParameterSymbol>(); 830foreach (var typeParameter in sortedMap.Values) 851private static IEnumerable<ITypeParameterSymbol> AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints( 870var typeParameters = new List<ITypeParameterSymbol>(); 875if (arguments[i] is ITypeParameterSymbol argument) 902private static IEnumerable<ITypeParameterSymbol> GetMethodTypeParametersInDeclaration(ITypeSymbol returnType, SortedDictionary<int, ITypeParameterSymbol> sortedMap)
ExtractMethod\MethodExtractor.AnalyzerResult.cs (8)
20IEnumerable<ITypeParameterSymbol> typeParametersInDeclaration, 21IEnumerable<ITypeParameterSymbol> typeParametersInConstraintList, 32private readonly IList<ITypeParameterSymbol> _typeParametersInDeclaration = typeParametersInDeclaration.ToList(); 33private readonly IList<ITypeParameterSymbol> _typeParametersInConstraintList = typeParametersInConstraintList.ToList(); 66public ReadOnlyCollection<ITypeParameterSymbol> MethodTypeParametersInDeclaration 70return new ReadOnlyCollection<ITypeParameterSymbol>(_typeParametersInDeclaration); 74public ReadOnlyCollection<ITypeParameterSymbol> MethodTypeParametersInConstraintList 78return new ReadOnlyCollection<ITypeParameterSymbol>(_typeParametersInConstraintList);
ExtractMethod\MethodExtractor.CodeGenerator.cs (3)
325protected ImmutableArray<ITypeParameterSymbol> CreateMethodTypeParameters() 332var set = new HashSet<ITypeParameterSymbol>(AnalyzerResult.MethodTypeParametersInConstraintList); 334var typeParameters = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (3)
17private readonly List<ITypeParameterSymbol> _typeParameters = []; 19public static IEnumerable<ITypeParameterSymbol> Collect(ITypeSymbol typeSymbol) 57public override void VisitTypeParameter(ITypeParameterSymbol typeParameterTypeSymbol)
GenerateType\AbstractGenerateTypeService.cs (5)
45protected abstract ImmutableArray<ITypeParameterSymbol> GetTypeParameters(State state, SemanticModel semanticModel, CancellationToken cancellationToken); 185protected static ImmutableArray<ITypeParameterSymbol> GetTypeParameters( 193using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameters); 203if (type is ITypeParameterSymbol typeParameter) 263protected IList<ITypeParameterSymbol> GetAvailableTypeParameters(
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (3)
83private ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWithDelegateChecks() 308private ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters() 320private IList<ITypeParameterSymbol> GetAvailableTypeParameters()
IntroduceVariable\AbstractIntroduceVariableService.State_Parameter.cs (1)
28if (bindingMap.AllReferencedSymbols.OfType<ITypeParameterSymbol>()
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
130public override void VisitTypeParameter(ITypeParameterSymbol symbol)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (4)
359else if (symbol is ITypeParameterSymbol typeParameter) 513if (typeArgument is ITypeParameterSymbol && typeArgument.Name == typeParameter.Name) 691private void AddDescriptionForTypeParameter(ITypeParameterSymbol symbol) 729ImmutableArray<ITypeParameterSymbol> typeParameters,
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (2)
78public ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 107public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
78public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters;
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
272if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Cref })
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
48foreach (var typeParameter in symbol.TypeParameters)
Shared\Extensions\ISymbolExtensions_2.cs (1)
197ITypeParameterSymbol typeParam => typeParam.ContainingSymbol.GetDocumentationComment(compilation, expandIncludes: true, expandInheritdoc: true, cancellationToken: cancellationToken)?.GetTypeParameter(typeParam.Name) ?? DocumentationComment.Empty,
Shared\Utilities\ExtractTypeHelpers.cs (13)
130public static ImmutableArray<ITypeParameterSymbol> GetRequiredTypeParametersForMembers(INamedTypeSymbol type, IEnumerable<ISymbol> includedMembers) 139var allReferencedTypeParameters = new HashSet<ITypeParameterSymbol>(directlyReferencedTypeParameters); 140var unanalyzedTypeParameters = new Queue<ITypeParameterSymbol>(directlyReferencedTypeParameters); 144var typeParameter = unanalyzedTypeParameters.Dequeue(); 148foreach (var originalTypeParameter in potentialTypeParameters) 163private static ImmutableArray<ITypeParameterSymbol> GetPotentialTypeParameters(INamedTypeSymbol type) 165using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameters); 184private static ImmutableArray<ITypeParameterSymbol> GetDirectlyReferencedTypeParameters(IEnumerable<ITypeParameterSymbol> potentialTypeParameters, IEnumerable<ISymbol> includedMembers) 186using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var directlyReferencedTypeParameters); 187foreach (var typeParameter in potentialTypeParameters) 198private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes) 223private static bool DoesTypeReferenceTypeParameter(ITypeSymbol type, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
263useSpread = method.GetOriginalUnreducedDefinition() is not IMethodSymbol { IsExtensionMethod: true, Parameters: [_, { Type: ITypeParameterSymbol }] };
src\Analyzers\Core\Analyzers\UseIsNullCheck\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;
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
289private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
189typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter
src\Analyzers\Core\CodeFixes\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)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
30protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (7)
39private ImmutableArray<ITypeParameterSymbol> _typeParameters; 40private IDictionary<ITypeSymbol, ITypeParameterSymbol> _typeArgumentToTypeParameterMap; 42public ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken) 49protected abstract ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken); 167private IDictionary<ITypeSymbol, ITypeParameterSymbol> GetTypeArgumentToTypeParameterMap( 173private IDictionary<ITypeSymbol, ITypeParameterSymbol> CreateTypeArgumentToTypeParameterMap( 183var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
59public override async ValueTask VisitTypeParameter(ITypeParameterSymbol symbol) 85private async ValueTask<ITypeSymbol> DetermineCommonDerivedTypeAsync(ITypeParameterSymbol symbol)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
483using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var combinedTypeParameters);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
317current is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
180if (first is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
267ITypeParameterSymbol typeParameter,
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
526var typeParameter = GetNthTypeParameter(bindingContext.ContainingType, typeParameterIndex); 836private static ITypeParameterSymbol GetNthTypeParameter(INamedTypeSymbol typeSymbol, int n)
Microsoft.CodeAnalysis.Features.UnitTests (8)
FindUsages\DefinitionItemFactoryTests.cs (8)
703var t1 = tuple.TypeParameters[0]; 704var t2 = tuple.TypeParameters[1]; 765var t1 = tuple.TypeParameters[0]; 766var t2 = tuple.TypeParameters[1]; 821var t1 = type.TypeParameters[0]; 822var t2 = type.TypeParameters[1]; 875var t1 = type.TypeParameters[0]; 876var t2 = type.TypeParameters[1];
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\TestOperationVisitor.cs (2)
781Assert.IsAssignableFrom<ITypeParameterSymbol>(constrainedToType); 882Assert.IsAssignableFrom<ITypeParameterSymbol>(constrainedToType);
Microsoft.CodeAnalysis.VisualBasic (33)
Binding\MemberSemanticModel.vb (1)
558Public Overloads Overrides Function GetDeclaredSymbol(typeParameter As TypeParameterSyntax, Optional cancellationToken As CancellationToken = Nothing) As ITypeParameterSymbol
Compilation\SemanticModel.vb (1)
2616Public 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)
953Private Function IMethodSymbol_GetTypeInferredDuringReduction(reducedFromTypeParameter As ITypeParameterSymbol) As ITypeSymbol Implements IMethodSymbol.GetTypeInferredDuringReduction 1092Private ReadOnly Property IMethodSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements IMethodSymbol.TypeParameters 1094Return StaticCast(Of ITypeParameterSymbol).From(Me.TypeParameters)
Symbols\NamedTypeSymbol.vb (2)
1387Private ReadOnly Property INamedTypeSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements INamedTypeSymbol.TypeParameters 1389Return StaticCast(Of ITypeParameterSymbol).From(Me.TypeParameters)
Symbols\TypeParameterSymbol.vb (18)
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 320Public MustOverride ReadOnly Property AllowsRefLikeType As Boolean Implements ITypeParameterSymbol.AllowsRefLikeType 322Friend MustOverride ReadOnly Property HasUnmanagedTypeConstraint As Boolean Implements ITypeParameterSymbol.HasUnmanagedTypeConstraint 324Private ReadOnly Property HasNotNullConstraint As Boolean Implements ITypeParameterSymbol.HasNotNullConstraint 330Public MustOverride ReadOnly Property Variance As VarianceKind Implements ITypeParameterSymbol.Variance 369Private ReadOnly Property ITypeParameterSymbol_ReferenceTypeConstraintNullableAnnotation As NullableAnnotation Implements ITypeParameterSymbol.ReferenceTypeConstraintNullableAnnotation 375Private ReadOnly Property ITypeParameterSymbol_DeclaringMethod As IMethodSymbol Implements ITypeParameterSymbol.DeclaringMethod 381Private ReadOnly Property ITypeParameterSymbol_DeclaringType As INamedTypeSymbol Implements ITypeParameterSymbol.DeclaringType 387Private ReadOnly Property ITypeParameterSymbol_Ordinal As Integer Implements ITypeParameterSymbol.Ordinal 393Private ReadOnly Property ITypeParameterSymbol_ConstraintTypes As ImmutableArray(Of ITypeSymbol) Implements ITypeParameterSymbol.ConstraintTypes 399Private ReadOnly Property ITypeParameterSymbol_ConstraintNullableAnnotations As ImmutableArray(Of NullableAnnotation) Implements ITypeParameterSymbol.ConstraintNullableAnnotations 405Private ReadOnly Property ITypeParameterSymbol_OriginalDefinition As ITypeParameterSymbol Implements ITypeParameterSymbol.OriginalDefinition 411Private 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 (14)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
158typeParameters:=ImmutableArray(Of ITypeParameterSymbol).Empty,
src\Analyzers\VisualBasic\CodeFixes\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)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\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
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (1)
202Public Overrides Function VisitTypeParameter(symbol As ITypeParameterSymbol) As TypeSyntax
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
TypeParameterChecker.vb (1)
26MyBase.New(acceptableTypeParameters.As(Of ITypeParameterSymbol))
Microsoft.CodeAnalysis.VisualBasic.Features (16)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
797newSymbol = matchingNewContainingMemberOrType.GetTypeParameters()(DirectCast(oldSymbol, ITypeParameterSymbol).Ordinal)
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
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (1)
158typeParameters:=ImmutableArray(Of ITypeParameterSymbol).Empty,
src\Analyzers\VisualBasic\CodeFixes\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)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
1784ByRef syntax As TypeParameterSyntax) As ITypeParameterSymbol
Semantics\GetSemanticInfoTests.vb (1)
4424ByRef syntax As TypeParameterSyntax) As ITypeParameterSymbol
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
SymbolsTests\UnmanagedTypeConstraintTests.vb (2)
1059Assert.False(DirectCast(s5T, ITypeParameterSymbol).HasUnmanagedTypeConstraint) 1065Assert.True(DirectCast(mT, ITypeParameterSymbol).HasUnmanagedTypeConstraint)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
2559Private Protected Overrides Function TypeParameter(symbol As ITypeParameterSymbol) As SyntaxNode
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\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
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (1)
202Public Overrides Function VisitTypeParameter(symbol As ITypeParameterSymbol) As TypeSyntax
Microsoft.CodeAnalysis.Workspaces (97)
Editing\SyntaxGenerator.cs (8)
207foreach (var typeParameter in method.TypeParameters) 240bool HasNullableAnnotation(ITypeParameterSymbol typeParameter, IMethodSymbol method) 246static bool IsNullableAnnotatedTypeParameter(ITypeParameterSymbol typeParameter, ITypeParameterSymbol current) 335private protected abstract SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter); 861private SyntaxNode WithTypeParametersAndConstraints(SyntaxNode declaration, ImmutableArray<ITypeParameterSymbol> typeParameters) 867foreach (var tp in typeParameters) 884private static bool HasSomeConstraint(ITypeParameterSymbol typeParameter)
FindSymbols\FindReferences\Finders\AbstractTypeParameterSymbolReferenceFinder.cs (2)
13internal abstract class AbstractTypeParameterSymbolReferenceFinder : AbstractReferenceFinder<ITypeParameterSymbol> 16ITypeParameterSymbol symbol,
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
31public override INamedTypeSymbol? VisitTypeParameter(ITypeParameterSymbol symbol)
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (3)
16protected override bool CanFind(ITypeParameterSymbol symbol) 20ITypeParameterSymbol symbol, 41ITypeParameterSymbol symbol,
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (2)
15protected override bool CanFind(ITypeParameterSymbol symbol) 19ITypeParameterSymbol symbol,
Recommendations\AbstractRecommendationService.cs (1)
107return ((ITypeParameterSymbol)symbol).TypeParameterKind != TypeParameterKind.Cref;
Recommendations\AbstractRecommendationServiceRunner.cs (5)
155if (parameterTypeSymbol.IsKind<ITypeParameterSymbol>(SymbolKind.TypeParameter, out var typeParameter)) 415if (originalMember is IMethodSymbol { Parameters: [{ Type: ITypeParameterSymbol parameterType }, ..] }) 458if (originalContainerType is ITypeParameterSymbol typeParameterContainer) 483if (originalContainerType is ITypeParameterSymbol typeParameterContainer)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
30public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (3)
417public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 425public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 427var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
96public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeParameterSymbolExtensions.cs (3)
12public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 19: type is ITypeParameterSymbol 20? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
64public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15IList<ITypeParameterSymbol> typeParameters, 73public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (8)
522var isTypeParameter1 = t1 is ITypeParameterSymbol; 523var isTypeParameter2 = t2 is ITypeParameterSymbol; 615foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 770IEnumerable<ITypeParameterSymbol> availableTypeParameters) 799public static IList<ITypeParameterSymbol> GetReferencedMethodTypeParameters( 800this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null) 807public static IList<ITypeParameterSymbol> GetReferencedTypeParameters( 808this ITypeSymbol? type, IList<ITypeParameterSymbol>? result = null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
68public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
47public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
62public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
66public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
63/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
479public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 500var typeParameter = (ITypeParameterSymbol)symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
13public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 26var typeParameter = method?.TypeParameters[ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\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())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (4)
212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i]; 222private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
132SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 615private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
73SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 259public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
160ImmutableArray<ITypeParameterSymbol> typeParameters, 181string name, ImmutableArray<ITypeParameterSymbol> typeParameters, 319public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 332public static ITypeParameterSymbol CreateTypeParameter( 423ImmutableArray<ITypeParameterSymbol> typeParameters = default, 442ImmutableArray<ITypeParameterSymbol> typeParameters = default, 470ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
48public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 55public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
102public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedMethodSymbol.cs (2)
58public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters; 84public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
103public override ImmutableArray<ITypeParameterSymbol> TypeParameters => _constructedFrom.TypeParameters;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (1)
30typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (1)
36typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (1)
21typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (3)
22public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 36ImmutableArray<ITypeParameterSymbol> typeParameters, 114public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
23private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 36ImmutableArray<ITypeParameterSymbol> typeParameters, 144public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (1)
35typeParameters: ImmutableArray<ITypeParameterSymbol>.Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (3)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol 45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
101private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 102ImmutableArray<ITypeParameterSymbol> typeParameters, 113var typeParameter = typeParameters[i]; 140return newTypeParameters.Cast<ITypeParameterSymbol>().ToImmutableArray();
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
175else if (symbol is ITypeParameterSymbol
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SymbolKeyTests.cs (2)
826var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>().Where(n => !n.IsImplicitlyDeclared).Single().TypeParameters.Single(); 839var typeParameter = GetDeclaredSymbols(compilation).OfType<INamedTypeSymbol>()
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
226else if (type is ITypeParameterSymbol)
Microsoft.VisualStudio.LanguageServices (6)
ChangeSignature\AddParameterDialogViewModel.cs (1)
255if (typeArgument is ITypeParameterSymbol)
Progression\GraphNodeIdCreation.cs (5)
80var typeParameter = (ITypeParameterSymbol)symbol; 97items.Add(GraphNodeId.GetPartial(CodeGraphNodeIdName.Parameter, ((ITypeParameterSymbol)symbol).Ordinal.ToString())); 135else if (symbol is ITypeParameterSymbol typeParameter) 257private 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
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (2)
347if (returnType is ITypeParameterSymbol { HasNotNullConstraint: false }) 369if (inputType is ITypeParameterSymbol { HasNotNullConstraint: false })