10 implementations of ITypeParameterSymbol
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeParameterSymbol.cs (1)
12internal sealed class TypeParameterSymbol : TypeSymbol, ITypeParameterSymbol
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeParameterSymbol.vb (1)
22Implements ITypeParameterSymbol, ITypeParameterSymbolInternal
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
1447 references to ITypeParameterSymbol
GenerateDocumentationAndConfigFiles (74)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
ILLink.RoslynAnalyzer (17)
DynamicallyAccessedMembersAnalyzer.cs (1)
253var attributableSymbol = attributableMethod.TypeParameters[i];
RequiresAnalyzerBase.cs (2)
83var typeParams = ImmutableArray<ITypeParameterSymbol>.Empty; 103var typeParam = typeParams[i];
TrimAnalysis\GenericArgumentDataFlow.cs (3)
44ImmutableArray<ITypeParameterSymbol> typeParameters, 115private static bool RequiresGenericArgumentDataFlow(ImmutableArray<ITypeParameterSymbol> typeParameters) 117foreach (var typeParameter in typeParameters)
TrimAnalysis\GenericParameterProxy.cs (2)
10public GenericParameterProxy(ITypeParameterSymbol typeParameterSymbol) => TypeParameterSymbol = typeParameterSymbol; 28public readonly ITypeParameterSymbol TypeParameterSymbol;
TrimAnalysis\GenericParameterValue.cs (2)
18public GenericParameterValue(ITypeParameterSymbol typeParameterSymbol, DynamicallyAccessedMemberTypes dynamicallyAccessedMemberTypes) 24public GenericParameterValue(ITypeParameterSymbol typeParameterSymbol)
TrimAnalysis\HandleCallAction.cs (3)
55public override bool VisitTypeParameter(ITypeParameterSymbol symbol) => true; 139if (staticType is null || staticTypeDef is null || staticType is ITypeParameterSymbol) 142if (staticType is ITypeParameterSymbol genericParam)
TrimAnalysis\MethodProxy.cs (1)
42foreach (var typeParameter in Method.TypeParameters)
TrimAnalysis\SingleValueExtensions.cs (2)
23new GenericParameterValue((ITypeParameterSymbol)underlyingType)), 33SymbolKind.TypeParameter => new GenericParameterValue((ITypeParameterSymbol)type),
TrimAnalysis\TypeProxy.cs (1)
21foreach (var typeParameter in namedType.TypeParameters)
Metrics (49)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Metrics.Legacy (49)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
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.AspNetCore.OpenApi.SourceGenerators (4)
Helpers\ISymbolExtensions.cs (3)
51public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 53var results = ImmutableArray.CreateBuilder<ITypeParameterSymbol>(); 64public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol)
XmlComments\XmlComment.InheritDoc.cs (1)
236var targetTypeParameter = symbol.GetAllTypeParameters().FirstOrDefault(p => p.Name == typeParamName.Value);
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.Analyzers (75)
MetaAnalyzers\RegisterActionAnalyzer.cs (1)
392ITypeParameterSymbol? typeParam = method.TypeParameters.FirstOrDefault(t => t.Name == DiagnosticWellKnownNames.TLanguageKindEnumName);
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
Microsoft.CodeAnalysis.AnalyzerUtilities (49)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Microsoft.CodeAnalysis.BannedApiAnalyzers (74)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
Microsoft.CodeAnalysis.CodeStyle (50)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
262useSpread = 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\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Microsoft.CodeAnalysis.CodeStyle.Fixes (49)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
285private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
182typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (7)
22protected abstract ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken); 23protected abstract ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken); 30protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker( 37private ImmutableArray<ITypeParameterSymbol> ComputeTypeParameters( 46var result = capturedTypeParameters.Except<ITypeParameterSymbol>(availableTypeParameters, SymbolEqualityComparer.Default).ToImmutableArray(); 55private ITypeParameterSymbol MassageTypeParameter( 56ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
28protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (7)
32private ImmutableArray<ITypeParameterSymbol> _typeParameters; 33private IDictionary<ITypeSymbol, ITypeParameterSymbol> _typeArgumentToTypeParameterMap; 35public ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken) 42protected abstract ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken); 160private IDictionary<ITypeSymbol, ITypeParameterSymbol> GetTypeArgumentToTypeParameterMap( 166private IDictionary<ITypeSymbol, ITypeParameterSymbol> CreateTypeArgumentToTypeParameterMap( 176var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
57public override async ValueTask VisitTypeParameter(ITypeParameterSymbol symbol) 83private async ValueTask<ITypeSymbol?> DetermineCommonDerivedTypeAsync(ITypeParameterSymbol symbol)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
465using var _1 = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var capturedMethodTypeParameters); 479using var _2 = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var combinedTypeParameters);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
310current is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
181if (first is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
268ITypeParameterSymbol typeParameter,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
Microsoft.CodeAnalysis.CSharp (39)
Compilation\CSharpSemanticModel.cs (1)
3262public abstract ITypeParameterSymbol GetDeclaredSymbol(TypeParameterSyntax typeParameter, CancellationToken cancellationToken = default(CancellationToken));
Compilation\MemberSemanticModel.cs (1)
892public 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)
2190public 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)
874!(symbol.IsParams && symbol.Type is { IsRefLikeType: true } or ITypeParameterSymbol { AllowsRefLikeType: true }))
SymbolDisplay\SymbolDisplayVisitor.Types.cs (7)
156public override void VisitTypeParameter(ITypeParameterSymbol symbol) 806private void AddTypeParameterVarianceIfNeeded(ITypeParameterSymbol symbol) 858var typeParam = (ITypeParameterSymbol)typeArg; 881private static bool TypeParameterHasConstraints(ITypeParameterSymbol typeParam) 896var 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)
419internal static TypeParameterSymbol? EnsureCSharpSymbolOrNull(this ITypeParameterSymbol? symbol, string paramName) 646internal static ITypeParameterSymbol? GetPublicSymbol(this TypeParameterSymbol? symbol) 648return symbol.GetPublicSymbol<ITypeParameterSymbol>(); 721internal static ImmutableArray<ITypeParameterSymbol> GetPublicSymbols(this ImmutableArray<TypeParameterSymbol> symbols) 723return GetPublicSymbols<ITypeParameterSymbol>(StaticCast<Symbol>.From(symbols));
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
259instance is { Type: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
937TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }] 953if (originalCreateMethod.Parameters.All(static p => p.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method })) 958if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }]) 984TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }]
src\Analyzers\CSharp\Analyzers\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorDiagnosticAnalyzer.cs (1)
81if (expressionType is ITypeParameterSymbol typeParameter &&
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (28)
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (10)
48protected override ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken) 50using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result); 61protected override ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken) 74var typeParameter = GetUniqueTypeParameter( 83var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 89var typeParameter = GetUniqueTypeParameter( 103private ITypeParameterSymbol GetUniqueTypeParameter( 108var methodTypeParameter = GetMethodTypeParameter(type, cancellationToken); 112private ITypeParameterSymbol? GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 117if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (5)
255foreach (var typeParameter in method.TypeParameters) 270private static TypeParameterConstraintSyntax GetConstraint(ITypeParameterSymbol typeParameter) 272using var _ = PooledHashSet<ITypeParameterSymbol>.GetInstance(out var visited); 277TypeParameterConstraintSyntax? GetConstraintRecursive(ITypeParameterSymbol typeParameter) 302if (constraintType is ITypeParameterSymbol constraintTypeParameter)
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)
19this ImmutableArray<ITypeParameterSymbol> typeParameters) 25this IEnumerable<ITypeParameterSymbol> typeParameters) 29foreach (var typeParameter in typeParameters) 37ITypeParameterSymbol 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)
640IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 662private static Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 664var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 669private static void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 680var returnTypeParameter = (ITypeParameterSymbol)returnType;
Microsoft.CodeAnalysis.CSharp.Features (35)
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)
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (3)
51ImmutableArray<ITypeParameterSymbol> MethodTypeParameters) 97using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var methodTypeParameters); 266var typeParameters = firstExtensionInfo.MethodTypeParameters.CastArray<ITypeParameterSymbol>();
ConvertToExtension\ExtensionMethodEqualityComparer.cs (4)
19IEqualityComparer<ITypeParameterSymbol>, 66public bool Equals(ITypeParameterSymbol? x, ITypeParameterSymbol? y) 110public int GetHashCode([DisallowNull] ITypeParameterSymbol obj)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1141else if (oldSymbol is ITypeParameterSymbol oldTypeParameter)
GenerateType\CSharpGenerateTypeService.cs (3)
69var typeParameter = parameterIndex < type.TypeParameters.Length ? type.TypeParameters[parameterIndex] : null; 76var typeParameter = parameterIndex < method.TypeParameters.Length ? method.TypeParameters[parameterIndex] : null; 467protected override ImmutableArray<ITypeParameterSymbol> GetTypeParameters(
SignatureHelp\GenericNameSignatureHelpProvider.cs (3)
211ITypeParameterSymbol parameter, 225ITypeParameterSymbol typeParam, 308private static bool TypeParameterHasConstraints(ITypeParameterSymbol typeParam)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
259instance is { Type: ITypeParameterSymbol { HasReferenceTypeConstraint: false } };
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
937TypeArguments: [ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method }] 953if (originalCreateMethod.Parameters.All(static p => p.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method })) 958if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }]) 984TypeArguments: [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)
48protected override ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken) 50using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result); 61protected override ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken) 74var typeParameter = GetUniqueTypeParameter( 83var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 89var typeParameter = GetUniqueTypeParameter( 103private ITypeParameterSymbol GetUniqueTypeParameter( 108var methodTypeParameter = GetMethodTypeParameter(type, cancellationToken); 112private ITypeParameterSymbol? GetMethodTypeParameter(TypeSyntax type, CancellationToken cancellationToken) 117if (info.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\LocalFunctionTests.cs (1)
5117var 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(); 6640var 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)
191var t1 = mylist.TypeParameters[0];
Symbols\Source\NullablePublicAPITests.cs (2)
825ITypeParameterSymbol typeParameterSymbol = ((INamedTypeSymbol)((INamedTypeSymbol)method.ReturnType).GetMembers("B").Single()).TypeParameters.Single(); 4180var 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 (20)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
1745private protected override SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
888if (excludeInstance && containerType is ITypeParameterSymbol && symbol.IsStatic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (5)
255foreach (var typeParameter in method.TypeParameters) 270private static TypeParameterConstraintSyntax GetConstraint(ITypeParameterSymbol typeParameter) 272using var _ = PooledHashSet<ITypeParameterSymbol>.GetInstance(out var visited); 277TypeParameterConstraintSyntax? GetConstraintRecursive(ITypeParameterSymbol typeParameter) 302if (constraintType is ITypeParameterSymbol constraintTypeParameter)
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)
19this ImmutableArray<ITypeParameterSymbol> typeParameters) 25this IEnumerable<ITypeParameterSymbol> typeParameters) 29foreach (var typeParameter in typeParameters) 37ITypeParameterSymbol 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)
640IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 662private static Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 664var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 669private static void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 680var returnTypeParameter = (ITypeParameterSymbol)returnType;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeGeneration\CodeGenerationTests.cs (3)
139ImmutableArray<ITypeParameterSymbol> typeParameters = default, 344ImmutableArray<ITypeParameterSymbol> typeParameters = default, 509ImmutableArray<ITypeParameterSymbol> typeParameters = default,
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (4)
AbstractTypeParameterChecker.cs (4)
14/// Shared <see cref="SymbolVisitor"/> that looks for instances of <see cref="ITypeParameterSymbol"/> 19private readonly HashSet<ITypeParameterSymbol> _acceptableTypeParameters; 21protected AbstractTypeParameterChecker(ImmutableArray<ITypeParameterSymbol> acceptableTypeParameters) 28public sealed override void VisitTypeParameter(ITypeParameterSymbol symbol)
Microsoft.CodeAnalysis.Extensions.Package (34)
Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Microsoft.CodeAnalysis.Features (141)
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
91if (type is ITypeParameterSymbol typeParameter && !typeParameter.HasConstructorConstraint)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
33if (type is ITypeParameterSymbol typeParameterSymbol)
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
106if (symbol is INamespaceSymbol or ITypeParameterSymbol)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (2)
337extensionParameter.Type is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter) 487if (receiverTypeSymbol is ITypeParameterSymbol typeParameter)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer_Constraints.cs (10)
16private static bool CheckConstraints(ITypeSymbol receiverTypeSymbol, ITypeParameterSymbol typeParameter) 30private static bool SatisfiesInterfaceConstraint(ITypeSymbol receiverTypeSymbol, ITypeParameterSymbol typeParameter) 33private static bool SatisfiesBaseTypeConstraint(ITypeSymbol receiverTypeSymbol, ITypeParameterSymbol typeParameter) 37ITypeParameterSymbol typeParameter, 41using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameterStack); 50if (constraintType is ITypeParameterSymbol toCheck) 67ITypeParameterSymbol typeParameter, 71using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameterStack); 80if (constraintType is ITypeParameterSymbol toCheck) 107if (type 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 (17)
2466protected static bool TypeParameterConstraintsEquivalent(ITypeParameterSymbol oldParameter, ITypeParameterSymbol newParameter, bool exact) 2476protected static bool TypeParametersEquivalent(ImmutableArray<ITypeParameterSymbol> oldParameters, ImmutableArray<ITypeParameterSymbol> newParameters, bool exact) 2824if (oldSymbol is ITypeParameterSymbol) 2887if (oldSymbol is IParameterSymbol or ITypeParameterSymbol) 2956if (!hasAssociatedSymbolInsert && newSymbol is ITypeParameterSymbol) 2997if (hasAssociatedSymbolInsert || newSymbol is IParameterSymbol or ITypeParameterSymbol) 3244if (newSymbol is IParameterSymbol or ITypeParameterSymbol) 3706ITypeParameterSymbol or 4385else if (oldSymbol is ITypeParameterSymbol oldTypeParameter && newSymbol is ITypeParameterSymbol newTypeParameter) 4402oldSymbol is not INamedTypeSymbol and not ITypeParameterSymbol and not IParameterSymbol && 4478private static void AnalyzeTypeParameter(ITypeParameterSymbol oldParameter, ITypeParameterSymbol newParameter, ref RudeEditKind rudeEdit, ref bool hasGeneratedAttributeChange) 4652if (oldSymbol is ITypeParameterSymbol) 6165ITypeParameterSymbol or IParameterSymbol => symbol.ContainingSymbol,
ExtractMethod\MethodExtractor.Analyzer.cs (22)
126var sortedMap = new SortedDictionary<int, ITypeParameterSymbol>(); 722private void AddTypeParametersToMap(IEnumerable<ITypeParameterSymbol> typeParameters, IDictionary<int, ITypeParameterSymbol> sortedMap) 724foreach (var typeParameter in typeParameters) 728private void AddTypeParameterToMap(ITypeParameterSymbol typeParameter, IDictionary<int, ITypeParameterSymbol> sortedMap) 749IDictionary<int, ITypeParameterSymbol> sortedMap) 755private void AppendMethodTypeParameterFromConstraint(SortedDictionary<int, ITypeParameterSymbol> sortedMap) 757var typeParametersInConstraint = new List<ITypeParameterSymbol>(); 760foreach (var typeParameter in sortedMap.Values) 774foreach (var typeParameter in typeParametersInConstraint) 778private void AppendMethodTypeParameterUsedDirectly(MultiDictionary<ISymbol, SyntaxToken> symbolMap, IDictionary<int, ITypeParameterSymbol> sortedMap) 780foreach (var typeParameter in symbolMap.Keys.OfType<ITypeParameterSymbol>()) 784private ImmutableArray<ITypeParameterSymbol> GetMethodTypeParametersInConstraintList( 787SortedDictionary<int, ITypeParameterSymbol> sortedMap) 799private void AppendTypeParametersInConstraintsUsedByConstructedTypeWithItsOwnConstraints(SortedDictionary<int, ITypeParameterSymbol> sortedMap) 802using var _2 = PooledHashSet<ITypeParameterSymbol>.GetInstance(out var candidates); 805foreach (var typeParameter in sortedMap.Values) 821ITypeSymbol type, HashSet<ITypeSymbol> visited, HashSet<ITypeParameterSymbol> typeParameters) 839if (arguments[i] is ITypeParameterSymbol argument) 860private ImmutableArray<ITypeParameterSymbol> GetMethodTypeParametersInDeclaration(ITypeSymbol returnType, SortedDictionary<int, ITypeParameterSymbol> sortedMap)
ExtractMethod\MethodExtractor.AnalyzerResult.cs (4)
23ImmutableArray<ITypeParameterSymbol> typeParametersInDeclaration, 24ImmutableArray<ITypeParameterSymbol> typeParametersInConstraintList, 33public ImmutableArray<ITypeParameterSymbol> MethodTypeParametersInDeclaration { get; } = typeParametersInDeclaration; 34public ImmutableArray<ITypeParameterSymbol> MethodTypeParametersInConstraintList { get; } = typeParametersInConstraintList;
ExtractMethod\MethodExtractor.CodeGenerator.cs (4)
402protected ImmutableArray<ITypeParameterSymbol> CreateMethodTypeParameters() 407var set = new HashSet<ITypeParameterSymbol>(AnalyzerResult.MethodTypeParametersInConstraintList); 409var typeParameters = ArrayBuilder<ITypeParameterSymbol>.GetInstance(); 410foreach (var parameter in AnalyzerResult.MethodTypeParametersInDeclaration)
ExtractMethod\MethodExtractor.cs (1)
235foreach (var typeParameter in TypeParameterCollector.Collect(type))
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (3)
20private readonly List<ITypeParameterSymbol> _typeParameters = []; 22public static IEnumerable<ITypeParameterSymbol> Collect(ITypeSymbol? typeSymbol) 60public override void VisitTypeParameter(ITypeParameterSymbol typeParameterTypeSymbol)
GenerateType\AbstractGenerateTypeService.cs (5)
39protected abstract ImmutableArray<ITypeParameterSymbol> GetTypeParameters(State state, SemanticModel semanticModel, CancellationToken cancellationToken); 179protected static ImmutableArray<ITypeParameterSymbol> GetTypeParameters( 187using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var typeParameters); 197if (type is ITypeParameterSymbol typeParameter) 257protected IList<ITypeParameterSymbol> GetAvailableTypeParameters(
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (3)
83private ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWithDelegateChecks() 308private ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters() 320private IList<ITypeParameterSymbol> GetAvailableTypeParameters()
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (1)
84if (expressionSymbol is INamedTypeSymbol or ITypeParameterSymbol)
IntroduceVariable\AbstractIntroduceVariableService.State_Parameter.cs (1)
26if (bindingMap.AllReferencedSymbols.OfType<ITypeParameterSymbol>()
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
130public override void VisitTypeParameter(ITypeParameterSymbol symbol)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (4)
360else if (symbol is ITypeParameterSymbol typeParameter) 514if (typeArgument is ITypeParameterSymbol && typeArgument.Name == typeParameter.Name) 692private void AddDescriptionForTypeParameter(ITypeParameterSymbol symbol) 730ImmutableArray<ITypeParameterSymbol> typeParameters,
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (2)
78public ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter) 107public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
77public ImmutableArray<ITypeParameterSymbol> TypeParameters => _symbol.TypeParameters;
QuickInfo\CommonSemanticQuickInfoProvider.cs (1)
278if (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)
131public static ImmutableArray<ITypeParameterSymbol> GetRequiredTypeParametersForMembers( 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( 187ImmutableArray<ITypeParameterSymbol> potentialTypeParameters, ImmutableArray<ISymbol> includedMembers) 189using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var directlyReferencedTypeParameters); 190foreach (var typeParameter in potentialTypeParameters) 201private static bool DoesMemberReferenceTypeParameter(ISymbol member, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes) 226private static bool DoesTypeReferenceTypeParameter(ITypeSymbol type, ITypeParameterSymbol typeParameter, HashSet<ITypeSymbol> checkedTypes)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (1)
262useSpread = 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)
285private static ITypeSymbol FixType(ITypeSymbol typeSymbol, SemanticModel semanticModel, IEnumerable<ITypeParameterSymbol> allTypeParameters)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
182typeToGenerateIn = typeInfo.Type is ITypeParameterSymbol typeParameter
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (7)
22protected abstract ImmutableArray<ITypeParameterSymbol> GetCapturedTypeParameters(CancellationToken cancellationToken); 23protected abstract ImmutableArray<ITypeParameterSymbol> GenerateTypeParameters(CancellationToken cancellationToken); 30protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker( 37private ImmutableArray<ITypeParameterSymbol> ComputeTypeParameters( 46var result = capturedTypeParameters.Except<ITypeParameterSymbol>(availableTypeParameters, SymbolEqualityComparer.Default).ToImmutableArray(); 55private ITypeParameterSymbol MassageTypeParameter( 56ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.MethodSignatureInfo.cs (1)
28protected override ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (7)
32private ImmutableArray<ITypeParameterSymbol> _typeParameters; 33private IDictionary<ITypeSymbol, ITypeParameterSymbol> _typeArgumentToTypeParameterMap; 35public ImmutableArray<ITypeParameterSymbol> DetermineTypeParameters(CancellationToken cancellationToken) 42protected abstract ImmutableArray<ITypeParameterSymbol> DetermineTypeParametersWorker(CancellationToken cancellationToken); 160private IDictionary<ITypeSymbol, ITypeParameterSymbol> GetTypeArgumentToTypeParameterMap( 166private IDictionary<ITypeSymbol, ITypeParameterSymbol> CreateTypeArgumentToTypeParameterMap( 176var result = new Dictionary<ITypeSymbol, ITypeParameterSymbol>(SymbolEqualityComparer.Default);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
57public override async ValueTask VisitTypeParameter(ITypeParameterSymbol symbol) 83private async ValueTask<ITypeSymbol?> DetermineCommonDerivedTypeAsync(ITypeParameterSymbol symbol)
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
465using var _1 = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var capturedMethodTypeParameters); 479using var _2 = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var combinedTypeParameters);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
310current is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (1)
181if (first is ITypeParameterSymbol typeParameter)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
268ITypeParameterSymbol 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.PerformanceSensitiveAnalyzers (74)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
Microsoft.CodeAnalysis.PublicApiAnalyzers (54)
DeclarePublicApiAnalyzer.Impl.cs (4)
959foreach (var typeParameter in symbol.TypeParameters) 1013public override bool VisitTypeParameter(ITypeParameterSymbol symbol) 1029foreach (var typeParameter in symbol.TypeParameters) 1040private static bool CheckTypeParameterConstraints(ITypeParameterSymbol symbol)
ITypeParameterSymbolExtensions.cs (1)
11public static bool HasReferenceTypeConstraint(this ITypeParameterSymbol typeParameterSymbol)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Microsoft.CodeAnalysis.ResxSourceGenerator (49)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\TestOperationVisitor.cs (2)
782Assert.IsAssignableFrom<ITypeParameterSymbol>(constrainedToType); 883Assert.IsAssignableFrom<ITypeParameterSymbol>(constrainedToType);
Microsoft.CodeAnalysis.VisualBasic (33)
Binding\MemberSemanticModel.vb (1)
557Public 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) 469Private Sub AddTypeParameterVarianceIfRequired(symbol As ITypeParameterSymbol) 500Dim typeParam = DirectCast(typeArg, ITypeParameterSymbol) 523Private Shared Function TypeParameterSpecialConstraintCount(typeParam As ITypeParameterSymbol) As Integer 529Private Sub AddTypeParameterConstraints(typeParam As ITypeParameterSymbol)
Symbols\MethodSymbol.vb (3)
983Private Function IMethodSymbol_GetTypeInferredDuringReduction(reducedFromTypeParameter As ITypeParameterSymbol) As ITypeSymbol Implements IMethodSymbol.GetTypeInferredDuringReduction 1122Private ReadOnly Property IMethodSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements IMethodSymbol.TypeParameters 1124Return StaticCast(Of ITypeParameterSymbol).From(Me.TypeParameters)
Symbols\NamedTypeSymbol.vb (2)
1389Private ReadOnly Property INamedTypeSymbol_TypeParameters As ImmutableArray(Of ITypeParameterSymbol) Implements INamedTypeSymbol.TypeParameters 1391Return 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)
63Protected Overrides Function GetCapturedTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 64Dim result = ArrayBuilder(Of ITypeParameterSymbol).GetInstance() 75Protected Overrides Function GenerateTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 94Dim list = ArrayBuilder(Of ITypeParameterSymbol).GetInstance() 110cancellationToken As CancellationToken) As ITypeParameterSymbol 118Private Function GetMethodTypeParameter(type As TypeSyntax, cancellationToken As CancellationToken) As ITypeParameterSymbol 121If TypeOf info.Type Is ITypeParameterSymbol AndAlso 122DirectCast(info.Type, ITypeParameterSymbol).TypeParameterKind = TypeParameterKind.Method Then 123Return 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)
773newSymbol = matchingNewContainingMemberOrType.GetTypeParameters()(DirectCast(oldSymbol, ITypeParameterSymbol).Ordinal)
GenerateType\VisualBasicGenerateTypeService.vb (2)
370cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 379Return ImmutableArray(Of ITypeParameterSymbol).Empty
SignatureHelp\GenericNameSignatureHelpProvider.vb (3)
146Private Overloads Shared Function Convert(parameter As ITypeParameterSymbol, semanticModel As SemanticModel, position As Integer, documentationCommentFormattingService As IDocumentationCommentFormattingService) As SignatureHelpSymbolParameter 158Private Shared Function AddConstraints(typeParam As ITypeParameterSymbol, 210Private 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)
63Protected Overrides Function GetCapturedTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 64Dim result = ArrayBuilder(Of ITypeParameterSymbol).GetInstance() 75Protected Overrides Function GenerateTypeParameters(cancellationToken As CancellationToken) As ImmutableArray(Of ITypeParameterSymbol) 94Dim list = ArrayBuilder(Of ITypeParameterSymbol).GetInstance() 110cancellationToken As CancellationToken) As ITypeParameterSymbol 118Private Function GetMethodTypeParameter(type As TypeSyntax, cancellationToken As CancellationToken) As ITypeParameterSymbol 121If TypeOf info.Type Is ITypeParameterSymbol AndAlso 122DirectCast(info.Type, ITypeParameterSymbol).TypeParameterKind = TypeParameterKind.Method Then 123Return DirectCast(info.Type, ITypeParameterSymbol)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (1)
1779ByRef syntax As TypeParameterSyntax) As ITypeParameterSymbol
Semantics\GetSemanticInfoTests.vb (1)
4420ByRef syntax As TypeParameterSyntax) As ITypeParameterSymbol
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
SymbolsTests\UnmanagedTypeConstraintTests.vb (2)
1058Assert.False(DirectCast(s5T, ITypeParameterSymbol).HasUnmanagedTypeConstraint) 1064Assert.True(DirectCast(mT, ITypeParameterSymbol).HasUnmanagedTypeConstraint)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
2516Private 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 (92)
Editing\SyntaxGenerator.cs (8)
207foreach (var typeParameter in method.TypeParameters) 240bool HasNullableAnnotation(ITypeParameterSymbol typeParameter, IMethodSymbol method) 246static bool IsNullableAnnotatedTypeParameter(ITypeParameterSymbol typeParameter, ITypeParameterSymbol current) 334private protected abstract SyntaxNode TypeParameter(ITypeParameterSymbol typeParameter); 860private SyntaxNode WithTypeParametersAndConstraints(SyntaxNode declaration, ImmutableArray<ITypeParameterSymbol> typeParameters) 866foreach (var tp in typeParameters) 883private 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)
17protected override bool CanFind(ITypeParameterSymbol symbol) 21ITypeParameterSymbol symbol, 42ITypeParameterSymbol symbol,
FindSymbols\FindReferences\Finders\TypeParameterSymbolReferenceFinder.cs (2)
15protected override bool CanFind(ITypeParameterSymbol symbol) 19ITypeParameterSymbol symbol,
Recommendations\AbstractRecommendationService.cs (1)
103return ((ITypeParameterSymbol)symbol).TypeParameterKind != TypeParameterKind.Cref;
Recommendations\AbstractRecommendationServiceRunner.cs (5)
155if (parameterTypeSymbol.IsKind<ITypeParameterSymbol>(SymbolKind.TypeParameter, out var typeParameter)) 424if (originalMember is IMethodSymbol { Parameters: [{ Type: ITypeParameterSymbol parameterType }, ..] }) 467if (originalContainerType is ITypeParameterSymbol typeParameterContainer) 492if (originalContainerType is ITypeParameterSymbol typeParameterContainer)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
Workspace\Solution\SolutionCompilationState.SymbolToProjectId.cs (1)
176else 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 (1)
ChangeSignature\AddParameterDialogViewModel.cs (1)
251if (typeArgument is ITypeParameterSymbol)
Microsoft.VisualStudio.LanguageServices.CSharp (3)
ObjectBrowser\DescriptionBuilder.cs (3)
320foreach (var typeParameterSymbol in typeSymbol.TypeParameters) 326foreach (var typeParameterSymbol in methodSymbol.TypeParameters) 330private async Task BuildConstraintsAsync(ITypeParameterSymbol typeParameterSymbol, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.VisualBasic (5)
ObjectBrowser\DescriptionBuilder.vb (5)
442typeParameters As ImmutableArray(Of ITypeParameterSymbol), 462typeParameter As ITypeParameterSymbol, 477typeParameter As ITypeParameterSymbol, 494typeParameter As ITypeParameterSymbol, 537Private Shared Function CountConstraints(typeParameter As ITypeParameterSymbol) As Integer
Roslyn.Diagnostics.Analyzers (78)
AbstractDoNotCopyValue.cs (4)
353public override void VisitTypeParameter(ITypeParameterSymbol symbol) 1542CheckTypeParameterSymbolInUnsupportedContext(operation, (ITypeParameterSymbol)symbol); 1586private void CheckTypeParameterSymbolInUnsupportedContext(IOperation operation, ITypeParameterSymbol? typeParameter) 1627foreach (var typeParameter in symbol.TypeParameters)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];
Roslyn.Diagnostics.CSharp.Analyzers (18)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (5)
255foreach (var typeParameter in method.TypeParameters) 270private static TypeParameterConstraintSyntax GetConstraint(ITypeParameterSymbol typeParameter) 272using var _ = PooledHashSet<ITypeParameterSymbol>.GetInstance(out var visited); 277TypeParameterConstraintSyntax? GetConstraintRecursive(ITypeParameterSymbol typeParameter) 302if (constraintType is ITypeParameterSymbol constraintTypeParameter)
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)
19this ImmutableArray<ITypeParameterSymbol> typeParameters) 25this IEnumerable<ITypeParameterSymbol> typeParameters) 29foreach (var typeParameter in typeParameters) 37ITypeParameterSymbol 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)
640IDictionary<ITypeParameterSymbol, ITypeSymbol> bestMap = null; 662private static Dictionary<ITypeParameterSymbol, ITypeSymbol> DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType) 664var result = new Dictionary<ITypeParameterSymbol, ITypeSymbol>(); 669private static void DetermineTypeParameterMapping(ITypeSymbol inferredType, ITypeSymbol returnType, Dictionary<ITypeParameterSymbol, ITypeSymbol> result) 680var returnTypeParameter = (ITypeParameterSymbol)returnType;
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (1)
202Public Overrides Function VisitTypeParameter(symbol As ITypeParameterSymbol) As TypeSyntax
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (2)
347if (returnType is ITypeParameterSymbol { HasNotNullConstraint: false }) 369if (inputType is ITypeParameterSymbol { HasNotNullConstraint: false })
Test.Utilities (49)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
Text.Analyzers (76)
IdentifiersShouldBeSpelledCorrectly.cs (2)
333foreach (var typeParameter in method.TypeParameters) 346foreach (var typeParameter in type.TypeParameters)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
115((ITypeParameterSymbol)type1).Ordinal == ((ITypeParameterSymbol)type2).Ordinal)
src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
88var typeParameterSymbol = (ITypeParameterSymbol)symbol; 256typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
64/// <item>Two <see cref="ITypeParameterSymbol"/> are the "same" if they have
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (2)
476public override void VisitTypeParameter(ITypeParameterSymbol typeParameterSymbol) 495if (symbol is ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } typeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (2)
11public static void Create(ITypeParameterSymbol symbol, int methodIndex, SymbolKeyWriter visitor) 24var 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\Extensions\Symbols\INamedTypeSymbolExtensions.cs (1)
33public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this INamedTypeSymbol? symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (3)
429public static ImmutableArray<ITypeParameterSymbol> GetTypeParameters(this ISymbol? symbol) 437public static ImmutableArray<ITypeParameterSymbol> GetAllTypeParameters(this ISymbol? symbol) 439var results = ArrayBuilder<ITypeParameterSymbol>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
98public override bool VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeParameterSymbolExtensions.cs (3)
14public static INamedTypeSymbol? GetNamedTypeSymbolConstraint(this ITypeParameterSymbol typeParameter) 21: type is ITypeParameterSymbol 22? GetNamedTypeSymbolConstraint((ITypeParameterSymbol)type)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (2)
15ArrayBuilder<ITypeParameterSymbol> typeParameters, 78public override void VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (9)
518var isTypeParameter1 = t1 is ITypeParameterSymbol; 519var isTypeParameter2 = t2 is ITypeParameterSymbol; 610foreach (var constraint in ((ITypeParameterSymbol)type).ConstraintTypes) 765IEnumerable<ITypeParameterSymbol> availableTypeParameters) 796this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 802this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result) 808this ITypeSymbol? type, ArrayBuilder<ITypeParameterSymbol> result, bool onlyMethodTypeParameters) 817public static IList<ITypeParameterSymbol> GetReferencedTypeParameters(this ITypeSymbol? type) 819using var _ = ArrayBuilder<ITypeParameterSymbol>.GetInstance(out var result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
70public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
48public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
65public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
69public override ITypeSymbol VisitTypeParameter(ITypeParameterSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (4)
222var typeParameter1 = method1.TypeParameters[i]; 223var typeParameter2 = method2.TypeParameters[i]; 232private bool HaveSameConstraints(ITypeParameterSymbol typeParameter1, ITypeParameterSymbol typeParameter2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (4)
133SymbolKind.TypeParameter => TypeParametersAreEquivalent((ITypeParameterSymbol)x, (ITypeParameterSymbol)y, equivalentTypesWithDifferingAssemblies), 617private bool TypeParametersAreEquivalent(ITypeParameterSymbol x, ITypeParameterSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
76SymbolKind.TypeParameter => CombineHashCodes((ITypeParameterSymbol)x, currentHash), 264public int CombineHashCodes(ITypeParameterSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (7)
156ImmutableArray<ITypeParameterSymbol> typeParameters, 177string? name, ImmutableArray<ITypeParameterSymbol> typeParameters, 315public static ITypeParameterSymbol CreateTypeParameterSymbol(string name, int ordinal = 0) 328public static ITypeParameterSymbol CreateTypeParameter( 419ImmutableArray<ITypeParameterSymbol> typeParameters = default, 438ImmutableArray<ITypeParameterSymbol> typeParameters = default, 466ImmutableArray<ITypeParameterSymbol> typeParameters = default,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (2)
43public abstract ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 50public abstract ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
97public 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\CodeGenerationMethodSymbol.cs (3)
17public override ImmutableArray<ITypeParameterSymbol> TypeParameters { get; } 31ImmutableArray<ITypeParameterSymbol> typeParameters, 109public override ITypeSymbol GetTypeInferredDuringReduction(ITypeParameterSymbol reducedFromTypeParameter)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
18private readonly ImmutableArray<ITypeParameterSymbol> _typeParameters; 31ImmutableArray<ITypeParameterSymbol> typeParameters, 139public override ImmutableArray<ITypeParameterSymbol> TypeParameters
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
45public new ITypeParameterSymbol OriginalDefinition => this; 47public ITypeParameterSymbol ReducedFrom => null;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
99private static ImmutableArray<ITypeParameterSymbol> RenameTypeParameters( 100ImmutableArray<ITypeParameterSymbol> typeParameters, 111var typeParameter = typeParameters[i]; 138return [.. newTypeParameters.Cast<ITypeParameterSymbol>()];