4 implementations of TypeParameters
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
48public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
114ImmutableArray<ITypeParameterSymbol> IMethodSymbol.TypeParameters
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
1092Private ReadOnly Property IMethodSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements IMethodSymbol.TypeParameters
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
48public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; }
128 references to TypeParameters
ILLink.RoslynAnalyzer (16)
DynamicallyAccessedMembersAnalyzer.cs (9)
224 for (int i = 0; i < overrideMethod.TypeParameters.Length; i++) { 225 var methodTypeParameterAnnotation = overrideMethod.TypeParameters[i].GetDynamicallyAccessedMemberTypes (); 226 var overriddenMethodTypeParameterAnnotation = baseMethod.TypeParameters[i].GetDynamicallyAccessedMemberTypes (); 231 var attributableSymbol = attributableMethod.TypeParameters[i]; 236 || (overrideMethod.TypeParameters[i].TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _) 237 && baseMethod.TypeParameters[i].TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _)) 240 var typeParameterOrigin = origin ?? overrideMethod.TypeParameters[i]; 244 overrideMethod.TypeParameters[i].GetDisplayName (), overrideMethod.GetDisplayName (), 245 baseMethod.TypeParameters[i].GetDisplayName (), baseMethod.GetDisplayName ()));
RequiresAnalyzerBase.cs (1)
79 typeParams = methodSymbol.TypeParameters;
TrimAnalysis\GenericArgumentDataFlow.cs (2)
25 ProcessGenericArgumentDataFlow (location, method.TypeArguments, method.TypeParameters, reportDiagnostic); 80 if (RequiresGenericArgumentDataFlow (method.TypeParameters))
TrimAnalysis\MethodProxy.cs (4)
34 internal partial bool HasGenericParametersCount (int genericParameterCount) => Method.TypeParameters.Length == genericParameterCount; 38 if (Method.TypeParameters.IsEmpty) 41 var builder = ImmutableArray.CreateBuilder<GenericParameterProxy> (Method.TypeParameters.Length); 42 foreach (var typeParameter in Method.TypeParameters) {
Microsoft.Analyzers.Extra (2)
CallAnalysis\Arrays.cs (2)
86foreach (var method in freezer.GetMembers("ToFrozenDictionary").OfType<IMethodSymbol>().Where(m => m.TypeParameters.Length == 2)) 95foreach (var method in freezer.GetMembers("ToFrozenSet").OfType<IMethodSymbol>().Where(m => m.TypeParameters.Length == 1))
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
236sourceGenerationSpec.SetterTypeParameterName = registerCallbackProviderMethodSymbol.TypeParameters[0].Name;
HubServerProxyGenerator.Parser.cs (1)
225sourceGenerationSpec.GetterTypeParameterName = getProxyMethodSymbol.TypeParameters[0].Name;
Microsoft.CodeAnalysis (13)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
507var count = methodContext.TypeParameters.Length; 510return TypeInfo.Create(methodContext.TypeParameters[methodTypeParameterIndex]); 550for (int i = 0; i < methodContext.TypeParameters.Length; ++i) 552if (methodContext.TypeParameters[i].Name == typeParameterName)
DocumentationCommentId.cs (4)
463if (symbol.TypeParameters.Length > 0) 466_builder.Append(symbol.TypeParameters.Length); 988var count = methodContext.TypeParameters.Length; 991results.Add(methodContext.TypeParameters[methodTypeParameterIndex]);
Symbols\ISymbolExtensions.cs (5)
33var typeArgs = new ITypeSymbol[reducedFrom.TypeParameters.Length]; 36for (int i = 0, n = method.TypeParameters.Length; i < n; i++) 39var typeParameter = method.TypeParameters[i]; 52for (int i = 0, n = reducedFrom.TypeParameters.Length; i < n; i++) 54var inferredType = method.GetTypeInferredDuringReduction(reducedFrom.TypeParameters[i]);
Microsoft.CodeAnalysis.CodeStyle (10)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
507var count = methodContext.TypeParameters.Length; 510return TypeInfo.Create(methodContext.TypeParameters[methodTypeParameterIndex]); 550for (int i = 0; i < methodContext.TypeParameters.Length; ++i) 552if (methodContext.TypeParameters[i].Name == typeParameterName)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
369IMethodSymbol m => m.TypeParameters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
116symbol.TypeParameters.Any(static (tp, self) => tp.Accept(self), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (1)
26var typeParameter = method?.TypeParameters[ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (3)
210for (var i = 0; i < method1.TypeParameters.Length; i++) 212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i];
Microsoft.CodeAnalysis.CodeStyle.Fixes (13)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
31=> _methodSymbol.TypeParameters;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
138method.TypeParameters.SelectAsArray(t => t.Name),
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
263return method.TypeParameters.Any(t => IsUnexpressibleTypeParameter(t, allowDelegateAndEnumConstraints)); 370method1.TypeParameters.Length == method2.TypeParameters.Length &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375accessor.TypeParameters, 536method.TypeParameters,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (6)
38method.TypeParameters.SelectAsArray(tp => tp.Name), 47if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) 54method.TypeParameters, newNames, typeGenerator); 57for (var i = 0; i < method.TypeParameters.Length; i++) 59mapping[method.TypeParameters[i]] = updatedTypeParameters[i]; 97method.TypeParameters,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (3)
212? method.TypeParameters.GenerateConstraintClauses() 228foreach (var typeParameter in method.TypeParameters) 251return TypeParameterGenerator.GenerateTypeParameterList(method.TypeParameters, info);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
641var typeArguments = method.ConstructedFrom.TypeParameters
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
14333var m5Tuple = ((IMethodSymbol)symbolInfo.Symbol).TypeParameters[0].ConstraintTypes.Single();
Microsoft.CodeAnalysis.CSharp.Features (3)
GenerateType\CSharpGenerateTypeService.cs (2)
81var typeParameter = parameterIndex < method.TypeParameters.Length ? method.TypeParameters[parameterIndex] : null;
SignatureHelp\GenericNameSignatureHelpProvider.cs (1)
201method.TypeParameters.Select(p => Convert(p, semanticModel, position, documentationCommentFormattingService)).ToList());
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\FunctionPointerTests.cs (2)
1946Assert.True(declaredSymbol.TypeParameters[0].Equals(functionPointer.Signature.ReturnType, TypeCompareKind.ConsiderEverything)); 1947Assert.True(declaredSymbol.TypeParameters[0].Equals(functionPointer.Signature.Parameters[0].Type, TypeCompareKind.ConsiderEverything));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Compilation\GetSemanticInfoTests.cs (4)
4046Assert.Same(method1.ReducedFrom.TypeParameters[0], method1.TypeParameters[0].ReducedFrom); 4047Assert.Null(method1.ReducedFrom.TypeParameters[0].ReducedFrom); 4051Assert.Equal("System.Reflection.FieldInfo", method1.GetTypeInferredDuringReduction(method1.ReducedFrom.TypeParameters[0]).ToTestDisplayString());
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
469foreach (ITypeParameterSymbol tp in m.TypeParameters)
Symbols\Source\NullablePublicAPITests.cs (1)
4183var typeParameters = localFunctionSymbol.TypeParameters[0];
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
163foreach (var typeParameter in method.TypeParameters)
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (3)
212? method.TypeParameters.GenerateConstraintClauses() 228foreach (var typeParameter in method.TypeParameters) 251return TypeParameterGenerator.GenerateTypeParameterList(method.TypeParameters, info);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
641var typeArguments = method.ConstructedFrom.TypeParameters
Microsoft.CodeAnalysis.Features (18)
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
76typeParameters: method.TypeParameters,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
2455oldMethod.TypeParameters.Length == newMethod.TypeParameters.Length &&
ExtractInterface\AbstractExtractInterfaceService.cs (1)
398typeParameters: method.TypeParameters,
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
87return _state.DelegateMethodSymbol.TypeParameters;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (1)
329var typeParametersReplacementQuery = calleeMethodSymbol.TypeParameters
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
48foreach (var typeParameter in symbol.TypeParameters)
RQName\RQNodeBuilder.cs (1)
247var typeParamCount = symbol.TypeParameters.Length;
Shared\Utilities\ExtractTypeHelpers.cs (1)
208method.TypeParameters.Any(static (t, arg) => t.ConstraintTypes.Any(static (c, arg) => DoesTypeReferenceTypeParameter(c, arg.typeParameter, arg.checkedTypes), (arg.typeParameter, arg.checkedTypes)), (typeParameter, checkedTypes)) ||
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
31=> _methodSymbol.TypeParameters;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
138method.TypeParameters.SelectAsArray(t => t.Name),
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (3)
263return method.TypeParameters.Any(t => IsUnexpressibleTypeParameter(t, allowDelegateAndEnumConstraints)); 370method1.TypeParameters.Length == method2.TypeParameters.Length &&
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
507var count = methodContext.TypeParameters.Length; 510return TypeInfo.Create(methodContext.TypeParameters[methodTypeParameterIndex]); 550for (int i = 0; i < methodContext.TypeParameters.Length; ++i) 552if (methodContext.TypeParameters[i].Name == typeParameterName)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
1092Private ReadOnly Property IMethodSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements IMethodSymbol.TypeParameters
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
138Return TypeParameterGenerator.GenerateTypeParameterList(method.TypeParameters)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
SignatureHelp\GenericNameSignatureHelpProvider.vb (1)
141method.TypeParameters.Select(Function(p) Convert(p, semanticModel, position, documentationCommentFormattingService)).ToList())
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
138Return TypeParameterGenerator.GenerateTypeParameterList(method.TypeParameters)
Microsoft.CodeAnalysis.Workspaces (23)
Editing\SyntaxGenerator.cs (4)
193typeParameters: method.TypeParameters.Select(p => TypeParameter(p)), 200if (method.TypeParameters.Length > 0) 207foreach (var typeParameter in method.TypeParameters) 228decl = this.WithTypeParametersAndConstraints(decl, method.TypeParameters);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (5)
26var ordinal = method.TypeParameters.IndexOf(symbol); 30if (method.PartialDefinitionPart != null && ordinal < method.PartialDefinitionPart.TypeParameters.Length) 31return new([method.PartialDefinitionPart.TypeParameters[ordinal]]); 33if (method.PartialImplementationPart != null && ordinal < method.PartialImplementationPart.TypeParameters.Length) 34return new([method.PartialImplementationPart.TypeParameters[ordinal]]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
369IMethodSymbol m => m.TypeParameters,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
116symbol.TypeParameters.Any(static (tp, self) => tp.Accept(self), this);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (1)
26var typeParameter = method?.TypeParameters[ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (3)
210for (var i = 0; i < method1.TypeParameters.Length; i++) 212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (2)
375accessor.TypeParameters, 536method.TypeParameters,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (6)
38method.TypeParameters.SelectAsArray(tp => tp.Name), 47if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) 54method.TypeParameters, newNames, typeGenerator); 57for (var i = 0; i < method.TypeParameters.Length; i++) 59mapping[method.TypeParameters[i]] = updatedTypeParameters[i]; 97method.TypeParameters,
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SymbolKeyTests.cs (2)
723var constructed = method.Construct(compilation.GetSpecialType(SpecialType.System_Int32), method.TypeParameters[1]); 840.Where(n => !n.IsImplicitlyDeclared).Single().GetMembers("M").OfType<IMethodSymbol>().Single().TypeParameters.Single();
UtilityTest\DocumentationCommentIdTests.cs (1)
346CheckReferenceId("M:Acme.OuterType`1.M``1(``0):``0", method.TypeParameters[0], compilation);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ObjectBrowser\DescriptionBuilder.cs (1)
334foreach (var typeParameterSymbol in methodSymbol.TypeParameters)
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
ObjectBrowser\DescriptionBuilder.vb (2)
209If methodSymbol.TypeParameters.Length > 0 Then 211BuildTypeParameterList(methodSymbol.TypeParameters)