10 types derived from TypeParameterSymbol
Microsoft.CodeAnalysis.CSharp (10)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (1)
18internal sealed class AnonymousTypeParameterSymbol : TypeParameterSymbol
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (1)
13protected sealed class ErrorTypeParameterSymbol : TypeParameterSymbol
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
25: TypeParameterSymbol
Symbols\Source\CrefTypeParameterSymbol.cs (1)
65internal sealed class CrefTypeParameterSymbol : TypeParameterSymbol
Symbols\Source\IndexedTypeParameterSymbol.cs (1)
27internal sealed class IndexedTypeParameterSymbol : TypeParameterSymbol
Symbols\Source\SourceTypeParameterSymbol.cs (1)
23internal abstract class SourceTypeParameterSymbolBase : TypeParameterSymbol, IAttributeTargetSymbol
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (1)
11internal sealed class SynthesizedReadOnlyListTypeParameterSymbol : TypeParameterSymbol
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
204private sealed class InlineArrayTypeParameterSymbol : TypeParameterSymbol
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (1)
14internal sealed class SynthesizedSimpleMethodTypeParameterSymbol : TypeParameterSymbol
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
22: TypeParameterSymbol
719 references to TypeParameterSymbol
Microsoft.CodeAnalysis.CSharp (719)
Binder\Binder.ValueChecks.cs (5)
2416if (receiver.Type is TypeParameterSymbol typeParameter) 2986private readonly TypeParameterSymbol _type; 2989internal TypeParameterThisParameterSymbol(ParameterSymbol underlyingParameter, TypeParameterSymbol type) 5474ImmutableArray<TypeParameterSymbol>.Empty, 5514ImmutableArray<TypeParameterSymbol>.Empty,
Binder\Binder_Constraints.cs (7)
25ImmutableArray<TypeParameterSymbol> typeParameters, 44foreach (var typeParameter in typeParameters) 385ImmutableArray<TypeParameterSymbol> typeParameters, 401TypeParameterSymbol typeParameter, 483TypeParameterSymbol typeParameter, 553static bool isValidConstraintType(TypeParameterSymbol typeParameter, TypeConstraintSyntax syntax, TypeWithAnnotations typeWithAnnotations, bool performOnlyCycleSafeValidation, BindingDiagnosticBag diagnostics) 556typeWithAnnotations.DefaultType is TypeParameterSymbol typeParameterInConstraint && typeParameterInConstraint.ContainingSymbol == (object)typeParameter.ContainingSymbol)
Binder\Binder_Conversions.cs (5)
417Debug.Assert(conversion.ConstrainedToTypeOpt is TypeParameterSymbol); 580method.Parameters[0].Type is ArrayTypeSymbol { IsSZArray: true, ElementType: TypeParameterSymbol }); 785return binder.BindTypeParameterCreationExpression(syntax, (TypeParameterSymbol)type, arguments, initializerOpt, typeSyntax: syntax, wasTargetTyped: true, diagnostics); 1093else if (targetType is TypeParameterSymbol typeParameter) 1163else if (targetType is TypeParameterSymbol typeParameter)
Binder\Binder_Expressions.cs (5)
5166return BindTypeParameterCreationExpression(node, (TypeParameterSymbol)type, diagnostics); 7026private BoundExpression BindTypeParameterCreationExpression(ObjectCreationExpressionSyntax node, TypeParameterSymbol typeParameter, BindingDiagnosticBag diagnostics) 7036private static bool TypeParameterHasParameterlessConstructor(SyntaxNode node, TypeParameterSymbol typeParameter, BindingDiagnosticBag diagnostics) 7048SyntaxNode node, TypeParameterSymbol typeParameter, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, 8720if (receiverOpt is { Type: TypeParameterSymbol { AllowsRefLikeType: true } } &&
Binder\Binder_Lookup.cs (4)
185this.LookupMembersInTypeParameter(result, (TypeParameterSymbol)type, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteInfo); 1168private void LookupMembersInTypeParameter(LookupResult current, TypeParameterSymbol typeParameter, string name, int arity, ConsList<TypeSymbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 1868this.AddMemberLookupSymbolsInfoInTypeParameter(result, (TypeParameterSymbol)type, options, originalBinder); 2033private void AddMemberLookupSymbolsInfoInTypeParameter(LookupSymbolsInfo result, TypeParameterSymbol type, LookupOptions options, Binder originalBinder)
Binder\Binder_NameConflicts.cs (2)
28ImmutableArray<TypeParameterSymbol> typeParameters, 37foreach (var tp in typeParameters)
Binder\Binder_Operators.cs (10)
405Debug.Assert(left.Type is not TypeParameterSymbol); 844case (BoundKind.DefaultLiteral, _) when right.Type is TypeParameterSymbol: 848case (_, BoundKind.DefaultLiteral) when left.Type is TypeParameterSymbol: 2388if (constrainedToTypeOpt is not TypeParameterSymbol) 3520if (targetType is TypeParameterSymbol { AllowsRefLikeType: true }) 3527else if (operandType is not TypeParameterSymbol { AllowsRefLikeType: true }) 3531if (operandType is TypeParameterSymbol) 3533Debug.Assert(operandType is TypeParameterSymbol { AllowsRefLikeType: false }); 3539if (targetType is TypeParameterSymbol) 3541Debug.Assert(targetType is TypeParameterSymbol { AllowsRefLikeType: false });
Binder\Binder_Patterns.cs (1)
465var interfaces = inputType is TypeParameterSymbol typeParam ? typeParam.EffectiveInterfacesNoUseSiteDiagnostics : inputType.AllInterfacesNoUseSiteDiagnostics;
Binder\Binder_WithExpression.cs (1)
42cloneMethod = SynthesizedRecordClone.FindValidCloneMethod(receiverType is TypeParameterSymbol typeParameter ? typeParameter.EffectiveBaseClass(ref useSiteInfo) : receiverType, ref useSiteInfo);
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1345ImmutableArray<TypeParameterSymbol> typeParameters = delegateType.TypeParameters;
Binder\ForEachLoopBinder.cs (3)
1245if (enumeratorType is TypeParameterSymbol { AllowsRefLikeType: true }) 1796var typeParameter = (TypeParameterSymbol)type;
Binder\LocalBinderFactory.cs (2)
314TypeParameterSymbol typeParameter => getMethodParametersFromTypeParameter(typeParameter), 339static ImmutableArray<ParameterSymbol> getMethodParametersFromTypeParameter(TypeParameterSymbol typeParameter)
Binder\Semantics\AccessCheck.cs (1)
646case TypeParameterSymbol typeParameter:
Binder\Semantics\Conversions\Conversion.cs (1)
511internal TypeParameterSymbol? ConstrainedToTypeOpt
Binder\Semantics\Conversions\ConversionsBase.cs (25)
1899private static bool HasIdentityConversionToAny(NamedTypeSymbol type, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> targetTypes) 2672return HasImplicitReferenceTypeParameterConversion((TypeParameterSymbol)source, destination, ref useSiteInfo); 2851public bool HasImplicitTypeParameterConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2863if (destination is TypeParameterSymbol { AllowsRefLikeType: false } && 2865source.DependsOn((TypeParameterSymbol)destination)) 2873private bool HasImplicitReferenceTypeParameterConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2906if (destination is TypeParameterSymbol { AllowsRefLikeType: false } && 2907source.DependsOn((TypeParameterSymbol)destination)) 2916private bool HasImplicitEffectiveBaseConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2940private bool HasImplicitEffectiveInterfaceSetConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2945private bool HasVarianceCompatibleInterfaceInEffectiveInterfaceSet(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3023if (typeToCheck is TypeParameterSymbol typeParameter) 3188TypeParameterSymbol typeParameterSymbol = (TypeParameterSymbol)typeParameters[paramIndex].Type; 3250private bool HasImplicitBoxingTypeParameterConversion(TypeParameterSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3283if (destination is TypeParameterSymbol { AllowsRefLikeType: false } d && 3311HasImplicitBoxingTypeParameterConversion((TypeParameterSymbol)source, destination, ref useSiteInfo)) 3535TypeParameterSymbol s = source as TypeParameterSymbol; 3536TypeParameterSymbol t = destination as TypeParameterSymbol; 3587TypeParameterSymbol s = source as TypeParameterSymbol; 3588TypeParameterSymbol t = destination as TypeParameterSymbol;
Binder\Semantics\Conversions\UserDefinedConversionAnalysis.cs (4)
23public readonly TypeParameterSymbol ConstrainedToTypeOpt; 31TypeParameterSymbol constrainedToTypeOpt, 49TypeParameterSymbol constrainedToTypeOpt, 68TypeParameterSymbol constrainedToTypeOpt,
Binder\Semantics\Conversions\UserDefinedConversions.cs (3)
17public static void AddTypesParticipatingInUserDefinedConversion(ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol? ConstrainedToTypeOpt)> result, TypeSymbol type, bool includeBaseTypes, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 92if (type is TypeParameterSymbol typeParameter) 114static void addFromClassOrStruct(ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol? ConstrainedToTypeOpt)> result, bool excludeExisting, TypeSymbol type, bool includeBaseTypes, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (7)
36var d = ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)>.GetInstance(); 74private static void ComputeUserDefinedExplicitConversionTypeSet(TypeSymbol source, TypeSymbol target, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 90ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, 102foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 117foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 127TypeParameterSymbol constrainedToTypeOpt, 146TypeParameterSymbol constrainedToTypeOpt,
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (7)
80var d = ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)>.GetInstance(); 118private static void ComputeUserDefinedImplicitConversionTypeSet(TypeSymbol s, TypeSymbol t, ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 146ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)> d, 255foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 270foreach ((NamedTypeSymbol declaringType, TypeParameterSymbol constrainedToTypeOpt) in d) 280TypeParameterSymbol constrainedToTypeOpt, 956var d = ArrayBuilder<(NamedTypeSymbol ParticipatingType, TypeParameterSymbol ConstrainedToTypeOpt)>.GetInstance();
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (7)
136if (!isShift && (leftOperatorSourceOpt is null || (leftOperatorSourceOpt is not TypeParameterSymbol && rightOperatorSourceOpt is TypeParameterSymbol))) 246interfaces = ((TypeParameterSymbol)operatorSourceOpt).AllEffectiveInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo); 721if ((left.Type is TypeParameterSymbol { AllowsRefLikeType: true } && right.IsLiteralNull()) || 722(right.Type is TypeParameterSymbol { AllowsRefLikeType: true } && left.IsLiteralNull())) 779return (operand.Type is TypeParameterSymbol { AllowsRefLikeType: true }) ? Conversion.Boxing : Conversions.ClassifyConversionFromExpression(operand, objectType, isChecked: isChecked, ref useSiteInfo); 895current = ((TypeParameterSymbol)type0).EffectiveBaseClass(ref useSiteInfo);
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (3)
380TypeSymbol constrainedToTypeOpt = type0 as TypeParameterSymbol; 399current = ((TypeParameterSymbol)type0).EffectiveBaseClass(ref useSiteInfo); 426interfaces = ((TypeParameterSymbol)type0).AllEffectiveInterfacesWithDefinitionUseSiteDiagnostics(ref useSiteInfo);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (19)
134private readonly ImmutableArray<TypeParameterSymbol> _methodTypeParameters; 169ImmutableArray<TypeParameterSymbol> methodTypeParameters, 317ImmutableArray<TypeParameterSymbol> methodTypeParameters, 490TypeParameterSymbol typeParameter = (TypeParameterSymbol)type.Type; 513var methodTypeParameter = (TypeParameterSymbol)methodTypeParameterWithAnnotations.Type; 629var ordinal = ((TypeParameterSymbol)target.Type).Ordinal; 982private static bool DoesInputTypeContain(BoundExpression argument, TypeSymbol formalParameterType, TypeParameterSymbol typeParameter) 1038TypeParameterSymbol typeParameter) 2258sourceBase = ((TypeParameterSymbol)source).EffectiveBaseClass(ref useSiteInfo); 2301var typeParameter = (TypeParameterSymbol)source; 2360var typeParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 2710var typeParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 2801var typeParameter = _methodTypeParameters[iParam]; 2833TypeParameterSymbol typeParameter, 2989static bool hasExpressionTypeConstraint(TypeParameterSymbol typeParameter) 3250TypeParameterSymbol pParam = _methodTypeParameters[iParam];
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4306ImmutableArray<TypeParameterSymbol> originalTypeParameters,
Binder\WithClassTypeParametersBinder.cs (5)
21private MultiDictionary<string, TypeParameterSymbol> _lazyTypeParameterMap; 35protected override MultiDictionary<string, TypeParameterSymbol> TypeParameterMap 41var result = new MultiDictionary<string, TypeParameterSymbol>(); 42foreach (TypeParameterSymbol tps in _namedType.TypeParameters) 56foreach (var parameter in _namedType.TypeParameters)
Binder\WithCrefTypeParametersBinder.cs (10)
22private MultiDictionary<string, TypeParameterSymbol> _lazyTypeParameterMap; 30protected override MultiDictionary<string, TypeParameterSymbol> TypeParameterMap 36MultiDictionary<string, TypeParameterSymbol> map = CreateTypeParameterMap(); 44private MultiDictionary<string, TypeParameterSymbol> CreateTypeParameterMap() 46var map = new MultiDictionary<string, TypeParameterSymbol>(); 78private void AddTypeParameters(TypeSyntax typeSyntax, MultiDictionary<string, TypeParameterSymbol> map) 103private void AddTypeParameters(MemberCrefSyntax memberSyntax, MultiDictionary<string, TypeParameterSymbol> map) 112private static void AddTypeParameters(GenericNameSyntax genericNameSyntax, MultiDictionary<string, TypeParameterSymbol> map) 132TypeParameterSymbol typeParameterSymbol = new CrefTypeParameterSymbol(name, i, typeParameterSyntax); 145foreach (TypeParameterSymbol typeParameter in kvp.Value)
Binder\WithMethodTypeParametersBinder.cs (5)
19private MultiDictionary<string, TypeParameterSymbol> _lazyTypeParameterMap; 37protected override MultiDictionary<string, TypeParameterSymbol> TypeParameterMap 43var result = new MultiDictionary<string, TypeParameterSymbol>(); 44foreach (var typeParameter in _methodSymbol.TypeParameters) 68foreach (var parameter in _methodSymbol.TypeParameters)
Binder\WithTypeParametersBinder.cs (1)
22protected abstract MultiDictionary<string, TypeParameterSymbol> TypeParameterMap { get; }
CodeGen\EmitExpression.cs (1)
441((TypeParameterSymbol)receiverType).EffectiveInterfacesNoUseSiteDiagnostics.IsEmpty) || // This could be a nullable value type, which must be copied in order to not mutate the original value
CodeGen\EmitOperators.cs (1)
375if (comparand is BoundConversion { Type.SpecialType: SpecialType.System_Object, ConversionKind: ConversionKind.Boxing, Operand.Type: TypeParameterSymbol { AllowsRefLikeType: true } } &&
Compilation\BuiltInOperators.cs (2)
885leftType = ((TypeParameterSymbol)leftType).EffectiveBaseClass(ref useSiteInfo); 896rightType = ((TypeParameterSymbol)rightType).EffectiveBaseClass(ref useSiteInfo);
Compilation\SyntaxTreeSemanticModel.cs (3)
2174private TypeParameterSymbol GetTypeParameterSymbol(ImmutableArray<TypeParameterSymbol> parameters, TypeParameterSyntax parameter) 2176foreach (var symbol in parameters)
Compiler\ClsComplianceChecker.cs (2)
553private void CheckTypeParameterCompliance(ImmutableArray<TypeParameterSymbol> typeParameters, NamedTypeSymbol context) 557foreach (TypeParameterSymbol typeParameter in typeParameters)
Compiler\DocumentationCommentCompiler.cs (8)
328HashSet<TypeParameterSymbol> documentedTypeParameters; 396foreach (TypeParameterSymbol typeParameter in GetTypeParameters(symbol)) 497out HashSet<TypeParameterSymbol> documentedTypeParameters, 638private static ImmutableArray<TypeParameterSymbol> GetTypeParameters(Symbol symbol) 648return ImmutableArray<TypeParameterSymbol>.Empty; 1130ref HashSet<TypeParameterSymbol> documentedTypeParameters, 1149documentedTypeParameters = new HashSet<TypeParameterSymbol>(); 1207if (!documentedTypeParameters.Add((TypeParameterSymbol)referencedSymbol))
Compiler\DocumentationCommentCompiler.DocumentationCommentWalker.cs (3)
38private HashSet<TypeParameterSymbol> _documentedTypeParameters; 47HashSet<TypeParameterSymbol> documentedTypeParameters) 124ref HashSet<TypeParameterSymbol> documentedTypeParameters)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (3)
39private HashSet<TypeParameterSymbol> _documentedTypeParameters; 47HashSet<TypeParameterSymbol> documentedTypeParameters, 71ref HashSet<TypeParameterSymbol> documentedTypeParameters,
Compiler\MethodBodySynthesizer.Lowered.cs (1)
249this.ImplementingMethod.Construct(this.TypeParameters.Cast<TypeParameterSymbol, TypeSymbol>()) :
DocumentationComments\DocumentationCommentIDVisitor.cs (1)
94public override object VisitTypeParameter(TypeParameterSymbol symbol, StringBuilder builder)
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (1)
148public override object VisitTypeParameter(TypeParameterSymbol symbol, StringBuilder builder)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (6)
431public override Symbol VisitTypeParameter(TypeParameterSymbol symbol) 724private static bool AreTypeParametersEqual(TypeParameterSymbol type, TypeParameterSymbol other) 770return AreTypeParametersEqual((TypeParameterSymbol)type, (TypeParameterSymbol)other); 938public override Symbol VisitTypeParameter(TypeParameterSymbol symbol)
Emitter\Model\MethodSymbolAdapter.cs (1)
337foreach (var @param in AdaptedMethodSymbol.TypeParameters)
Emitter\Model\NamedTypeSymbolAdapter.cs (1)
459foreach (var t in AdaptedNamedTypeSymbol.TypeParameters)
Emitter\Model\PEModuleBuilder.cs (2)
1127internal static Cci.IGenericParameterReference Translate(TypeParameterSymbol param) 1158return Translate((TypeParameterSymbol)typeSymbol);
Emitter\Model\TypeParameterSymbolAdapter.cs (2)
390internal TypeParameterSymbolAdapter(TypeParameterSymbol underlyingTypeParameterSymbol) 396internal TypeParameterSymbol AdaptedTypeParameterSymbol { get; }
FlowAnalysis\NullableWalker.cs (10)
2282if (type.Type.IsTypeParameterDisallowingAnnotationInCSharp8() && !(type.Type is TypeParameterSymbol { IsNotNullable: true })) 5512TypeParameterSymbol tp => tp.EffectiveBaseClassNoUseSiteDiagnostics, 5518TypeParameterSymbol tp => tp.AllEffectiveInterfacesNoUseSiteDiagnostics, 9160type is TypeParameterSymbol typeParameter1 && 9161dependsOnTypeParameter(typeParameter1, (TypeParameterSymbol)targetType.Type, NullableAnnotation.NotAnnotated, out var annotation)) 9191type is TypeParameterSymbol typeParameter1 && 9192targetType.Type is TypeParameterSymbol typeParameter2) 9231static bool dependsOnTypeParameter(TypeParameterSymbol typeParameter1, TypeParameterSymbol typeParameter2, NullableAnnotation typeParameter1Annotation, out NullableAnnotation annotation) 9242if (constraintType.Type is TypeParameterSymbol constraintTypeParameter &&
Lowering\ClosureConversion\ClosureConversion.cs (1)
118private ImmutableArray<TypeParameterSymbol> _currentTypeParameters;
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (1)
52ImmutableArray<TypeParameterSymbol> typeParameters;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
239_ when variableType is TypeParameterSymbol { AllowsRefLikeType: true }
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
159public override ImmutableArray<TypeParameterSymbol> TypeParameters 161get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Lowering\LocalRewriter\DelegateCacheRewriter.cs (8)
163var usedTypeParameters = PooledHashSet<TypeParameterSymbol>.GetInstance(); 193static bool usedTypeParametersContains(HashSet<TypeParameterSymbol> used, ImmutableArray<TypeParameterSymbol> typeParameters) 195foreach (var typeParameter in typeParameters) 207private static void FindTypeParameters(TypeSymbol type, HashSet<TypeParameterSymbol> result) 210private static void FindTypeParameters(MethodSymbol method, HashSet<TypeParameterSymbol> result) 220private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_typeParameterSymbolCollector = (typeSymbol, result, _) => 222if (typeSymbol is TypeParameterSymbol typeParameter)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
1223var constrainedToTypeOpt = conversion.ConstrainedToTypeOpt; 1368var constrainedToTypeOpt = conversion.ConstrainedToTypeOpt; 1445var constrainedToTypeOpt = conversion.ConstrainedToTypeOpt;
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
314var rewrittenNewT = MakeNewT(node.Syntax, (TypeParameterSymbol)node.Type); 323private BoundExpression MakeNewT(SyntaxNode syntax, TypeParameterSymbol typeParameter)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
699return synthesizedContainer.Construct(synthesizedContainer.ConstructedFromTypeParameters.Cast<TypeParameterSymbol, TypeSymbol>());
Lowering\MethodToClassRewriter.cs (2)
747ImmutableArray<TypeParameterSymbol> typeParameters; 750typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
Lowering\SynthesizedMethodBaseSymbol.cs (3)
29private ImmutableArray<TypeParameterSymbol> _typeParameters; 60protected void AssignTypeMapAndTypeParameters(TypeMap typeMap, ImmutableArray<TypeParameterSymbol> typeParameters) 91public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Lowering\SyntheticBoundNodeFactory.cs (1)
1480arg.Type is TypeParameterSymbol { AllowsRefLikeType: true } && type.IsObjectType())
Operations\CSharpOperationFactory.cs (9)
454TypeParameterSymbol? constrainedToType = GetConstrainedToType(targetMethod, boundCall.ReceiverOpt); 461private static TypeParameterSymbol? GetConstrainedToType(Symbol targetMember, BoundExpression? receiverOpt) 464receiverOpt is BoundTypeExpression { Type: TypeParameterSymbol typeParameter }) 620TypeParameterSymbol? constrainedToType = GetConstrainedToType(boundPropertyAccess.PropertySymbol, boundPropertyAccess.ReceiverOpt); 639TypeParameterSymbol? constrainedToType = GetConstrainedToType(property, boundIndexerAccess.ReceiverOpt); 650TypeParameterSymbol? constrainedToType = GetConstrainedToType(boundEventAccess.EventSymbol, boundEventAccess.ReceiverOpt); 1162TypeParameterSymbol? constrainedToType = GetConstrainedToType(methodSymbol, boundMethodGroup.ReceiverOpt); 1374private static TypeParameterSymbol? GetConstrainedToTypeForOperator(MethodSymbol? operatorMethod, TypeSymbol? constrainedToTypeOpt) 1377constrainedToTypeOpt is TypeParameterSymbol typeParameter)
Operations\CSharpOperationFactory_Methods.cs (1)
136TypeParameterSymbol? constrainedToType = GetConstrainedToType(boundEventAssignmentOperator.Event, boundEventAssignmentOperator.ReceiverOpt);
Symbols\AbstractTypeMap.cs (7)
105return SubstituteTypeParameter((TypeParameterSymbol)previous); 179protected virtual TypeWithAnnotations SubstituteTypeParameter(TypeParameterSymbol typeParameter) 342TypeParameterSymbol owner, 345HashSet<TypeParameterSymbol> ignoreTypesDependentOnTypeParametersOpt) 400internal ImmutableArray<TypeParameterSymbol> SubstituteTypeParameters(ImmutableArray<TypeParameterSymbol> original) 402return original.SelectAsArray((tp, m) => (TypeParameterSymbol)m.SubstituteTypeParameter(tp).AsTypeSymbolOnly(), this);
Symbols\AbstractTypeParameterMap.cs (3)
20protected readonly SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> Mapping; 22protected AbstractTypeParameterMap(SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> mapping) 27protected sealed override TypeWithAnnotations SubstituteTypeParameter(TypeParameterSymbol typeParameter)
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (9)
339static SynthesizedDelegateKey getTemplateKey(AnonymousTypeDescriptor typeDescr, ImmutableArray<TypeParameterSymbol> typeParameters) 351private static ImmutableArray<TypeParameterSymbol> GetReferencedTypeParameters(AnonymousTypeDescriptor typeDescr) 353var referenced = PooledHashSet<TypeParameterSymbol>.GetInstance(); 361if (type is TypeParameterSymbol typeParameter) 371ImmutableArray<TypeParameterSymbol> typeParameters; 374typeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 378var builder = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 386static int compareTypeParameters(TypeParameterSymbol x, TypeParameterSymbol y)
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (2)
90public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 92get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (6)
73private static ImmutableArray<TypeParameterSymbol> CreateTypeParameters(AnonymousDelegateTemplateSymbol containingType, int parameterCount, bool returnsVoid, bool hasParamsArray) 77var typeParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(parameterCount + (returnsVoid ? 0 : 1)); 158internal AnonymousDelegateTemplateSymbol(AnonymousTypeManager manager, AnonymousTypeDescriptor typeDescr, ImmutableArray<TypeParameterSymbol> typeParametersToSubstitute) 171TypeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 176var typeParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(typeParameterCount); 244public override ImmutableArray<TypeParameterSymbol> TypeParameters { get; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
113public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 115get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (3)
26private readonly ImmutableArray<TypeParameterSymbol> _typeParameters; 50var typeParametersBuilder = ArrayBuilder<TypeParameterSymbol>.GetInstance(fieldsCount); 150public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (4)
122internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 132internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 137internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 142internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\Compilation_WellKnownMembers.cs (4)
1191TypeParameterSymbol typeParam = (TypeParameterSymbol)type; 1205TypeParameterSymbol typeParam = (TypeParameterSymbol)type;
Symbols\ConstraintsHelper.cs (40)
28public readonly TypeParameterSymbol TypeParameter; 31public TypeParameterDiagnosticInfo(TypeParameterSymbol typeParameter, UseSiteInfo<AssemblySymbol> useSiteInfo) 74ConsList<TypeParameterSymbol> inProgress, 129this TypeParameterSymbol typeParameter, 131ConsList<TypeParameterSymbol> inProgress, 170var constraintTypeParameter = (TypeParameterSymbol)constraintType.Type; 171ConsList<TypeParameterSymbol> constraintsInProgress; 188constraintsInProgress = ConsList<TypeParameterSymbol>.Empty; 244var underlyingTypeParameter = (TypeParameterSymbol)underlyingType; 347ImmutableArray<TypeParameterSymbol> typeParameters, 377ImmutableArray<TypeParameterSymbol> typeParameters, 415internal static ImmutableArray<TypeParameterConstraintClause> AdjustConstraintKindsBasedOnConstraintTypes(ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeParameterConstraintClause> constraintClauses) 421SmallDictionary<TypeParameterSymbol, bool> isValueTypeMap = TypeParameterConstraintClause.BuildIsValueTypeMap(typeParameters, constraintClauses); 422SmallDictionary<TypeParameterSymbol, bool> isReferenceTypeFromConstraintTypesMap = TypeParameterConstraintClause.BuildIsReferenceTypeFromConstraintTypesMap(typeParameters, constraintClauses); 428var typeParameter = typeParameters[i]; 465TypeParameterSymbol typeParameter, 892ImmutableArray<TypeParameterSymbol> typeParameters, 898HashSet<TypeParameterSymbol> ignoreTypeConstraintsDependentOnTypeParametersOpt = null) 929TypeParameterSymbol typeParameter, 1032TypeParameterSymbol typeParameter, 1037HashSet<TypeParameterSymbol> ignoreTypeConstraintsDependentOnTypeParametersOpt) 1093static bool errorIfNotSatisfiesConstructorConstraint(Symbol containingSymbol, TypeParameterSymbol typeParameter, TypeWithAnnotations typeArgument, ArrayBuilder<TypeParameterDiagnosticInfo> diagnosticsBuilder) 1118TypeParameterSymbol typeParameter, 1142TypeParameterSymbol typeParameter, 1217var typeParameter = type as TypeParameterSymbol; 1255var typeParameter = type as TypeParameterSymbol; 1273TypeParameterSymbol typeParameter, 1358var typeParameter = (TypeParameterSymbol)typeArgument.Type; 1412private static bool IsReferenceType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1414return typeParameter.HasReferenceTypeConstraint || TypeParameterSymbol.CalculateIsReferenceTypeFromConstraintTypes(constraintTypes); 1417private static bool IsValueType(TypeParameterSymbol typeParameter, ImmutableArray<TypeWithAnnotations> constraintTypes) 1419return typeParameter.HasValueTypeConstraint || TypeParameterSymbol.CalculateIsValueTypeFromConstraintTypes(constraintTypes); 1422private static TypeParameterDiagnosticInfo GenerateConflictingConstraintsError(TypeParameterSymbol typeParameter, TypeSymbol deducedBase, bool classConflict) 1473var typeParameter = (TypeParameterSymbol)typeArgument;
Symbols\ConstructedNamedTypeSymbol.cs (1)
96internal static bool TypeParametersMatchTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeWithAnnotations> typeArguments)
Symbols\ErrorMethodSymbol.cs (2)
148public override ImmutableArray<TypeParameterSymbol> TypeParameters 150get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\ErrorTypeSymbol.cs (9)
24private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 311public override ImmutableArray<TypeParameterSymbol> TypeParameters 319default(ImmutableArray<TypeParameterSymbol>)); 325private ImmutableArray<TypeParameterSymbol> GetTypeParameters() 330return ImmutableArray<TypeParameterSymbol>.Empty; 334var @params = new TypeParameterSymbol[arity]; 675public override ImmutableArray<TypeParameterSymbol> TypeParameters 704private readonly ImmutableArray<TypeParameterSymbol> _typeParameters; 714public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (4)
162internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 167internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 172internal override NamedTypeSymbol? GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 177internal override TypeSymbol? GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (2)
820public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\MemberSignatureComparer.cs (9)
641public static bool HaveSameConstraints(ImmutableArray<TypeParameterSymbol> typeParameters1, TypeMap? typeMap1, ImmutableArray<TypeParameterSymbol> typeParameters2, TypeMap? typeMap2) 657public static bool HaveSameConstraints(TypeParameterSymbol typeParameter1, TypeMap? typeMap1, TypeParameterSymbol typeParameter2, TypeMap? typeMap2) 674private static bool HaveSameTypeConstraints(TypeParameterSymbol typeParameter1, TypeMap? typeMap1, TypeParameterSymbol typeParameter2, TypeMap? typeMap2, IEqualityComparer<TypeSymbol> comparer) 701public static bool HaveSameNullabilityInConstraints(TypeParameterSymbol typeParameter1, TypeMap typeMap1, TypeParameterSymbol typeParameter2, TypeMap typeMap2) 721private static bool AreConstraintTypesSubset(HashSet<TypeSymbol> constraintTypes1, HashSet<TypeSymbol> constraintTypes2, TypeParameterSymbol typeParameter2)
Symbols\MemberSymbolExtensions.cs (2)
322internal static ImmutableArray<TypeParameterSymbol> GetMemberTypeParameters(this Symbol symbol) 334return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (2)
70TypeParameterSymbol typeParameter; 86private static void GetGenericTypeParameterSymbol(int position, NamedTypeSymbol namedType, out int cumulativeArity, out TypeParameterSymbol typeArgument)
Symbols\Metadata\PE\PEMethodSymbol.cs (9)
387private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 843ImmutableArray<TypeParameterSymbol>.Empty); 906public override ImmutableArray<TypeParameterSymbol> TypeParameters 921private ImmutableArray<TypeParameterSymbol> EnsureTypeParametersAreLoaded(ref DiagnosticInfo diagnosticInfo) 932private ImmutableArray<TypeParameterSymbol> LoadTypeParameters(ref DiagnosticInfo diagnosticInfo) 941return ImmutableArray<TypeParameterSymbol>.Empty; 945var ownedParams = ImmutableArray.CreateBuilder<TypeParameterSymbol>(gpHandles.Count); 957return ImmutableArray<TypeParameterSymbol>.Empty; 1490foreach (var typeParam in TypeParameters)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (9)
1644public override ImmutableArray<TypeParameterSymbol> TypeParameters 1648return ImmutableArray<TypeParameterSymbol>.Empty; 2179foreach (var typeParameter in TypeParameters) 2613private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 2633_lazyTypeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 2676public override ImmutableArray<TypeParameterSymbol> TypeParameters 2701var ownedParams = ArrayBuilder<TypeParameterSymbol>.GetInstance(_arity); 2763var containingTypeParameter = containingTypeParameters[i]; 2764var nestedTypeParameter = nestedTypeParameters[i];
Symbols\Metadata\PE\PETypeParameterSymbol.cs (5)
615internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 621internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 627internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 633internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress) 657private TypeParameterBounds GetBounds(ConsList<TypeParameterSymbol> inProgress)
Symbols\Metadata\PE\SymbolFactory.cs (1)
141ImmutableArray<TypeParameterSymbol> typeParameters = genericType.GetAllTypeParameters();
Symbols\MethodSymbol.cs (2)
269public abstract ImmutableArray<TypeParameterSymbol> TypeParameters { get; } 831public virtual TypeSymbol GetTypeInferredDuringReduction(TypeParameterSymbol reducedFromTypeParameter)
Symbols\MutableTypeMap.cs (2)
20: base(new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>()) 24internal void Add(TypeParameterSymbol key, TypeWithAnnotations value)
Symbols\NamedTypeSymbol.cs (3)
63public abstract ImmutableArray<TypeParameterSymbol> TypeParameters { get; } 1002var allTypeParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 1033ArrayBuilder<TypeParameterSymbol> allTypeParameters,
Symbols\NativeIntegerTypeSymbol.cs (4)
38public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty; 351public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\PlaceholderTypeArgumentSymbol.cs (1)
20public static ImmutableArray<TypeWithAnnotations> CreateTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters)
Symbols\PublicModel\TypeParameterSymbol.cs (3)
14private readonly Symbols.TypeParameterSymbol _underlying; 16public TypeParameterSymbol(Symbols.TypeParameterSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation) 33internal Symbols.TypeParameterSymbol UnderlyingTypeParameterSymbol => _underlying;
Symbols\ReducedExtensionMethodSymbol.cs (4)
26private readonly ImmutableArray<TypeParameterSymbol> _typeParameters; 173var notInferredTypeParameters = PooledHashSet<TypeParameterSymbol>.GetInstance(); 257public override TypeSymbol GetTypeInferredDuringReduction(TypeParameterSymbol reducedFromTypeParameter) 286public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Retargeting\RetargetingMethodSymbol.cs (4)
36private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 93public override ImmutableArray<TypeParameterSymbol> TypeParameters 101_lazyTypeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 106this.RetargetingTranslator.Retarget(_underlyingMethod.TypeParameters), default(ImmutableArray<TypeParameterSymbol>));
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (4)
29private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 63public override ImmutableArray<TypeParameterSymbol> TypeParameters 71_lazyTypeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 76this.RetargetingTranslator.Retarget(_underlyingType.TypeParameters), default(ImmutableArray<TypeParameterSymbol>));
Symbols\Retargeting\RetargetingSymbolTranslator.cs (11)
101return new RetargetingTypeParameterSymbol(this, (TypeParameterSymbol)symbol); 565ArrayBuilder<TypeParameterSymbol> newParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(newArguments.Count); 690public virtual TypeParameterSymbol Retarget(TypeParameterSymbol typeParameter) 692return (TypeParameterSymbol)this.SymbolMap.GetOrAdd(typeParameter, _retargetingModule._createRetargetingTypeParameter); 867public ImmutableArray<TypeParameterSymbol> Retarget(ImmutableArray<TypeParameterSymbol> list) 1044public override TypeParameterSymbol Retarget(TypeParameterSymbol typeParameter) 1369public override Symbol VisitTypeParameter(TypeParameterSymbol symbol, RetargetOptions options)
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (5)
38public RetargetingTypeParameterSymbol(RetargetingModuleSymbol retargetingModule, TypeParameterSymbol underlyingTypeParameter) 84internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 97internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 102internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 107internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\SignatureOnlyMethodSymbol.cs (3)
25private readonly ImmutableArray<TypeParameterSymbol> _typeParameters; 39ImmutableArray<TypeParameterSymbol> typeParameters, 71public override ImmutableArray<TypeParameterSymbol> TypeParameters { get { return _typeParameters; } }
Symbols\Source\CrefTypeParameterSymbol.cs (4)
197internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 202internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 207internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 213internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\Source\ImplicitNamedTypeSymbol.cs (2)
86public override ImmutableArray<TypeParameterSymbol> TypeParameters 88get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\IndexedTypeParameterSymbol.cs (11)
29private static TypeParameterSymbol[] s_parameterPool = Array.Empty<TypeParameterSymbol>(); 46internal static TypeParameterSymbol GetTypeParameter(int index) 62var newPool = new TypeParameterSymbol[newPoolSize]; 85internal static ImmutableArray<TypeParameterSymbol> TakeSymbols(int count) 92ArrayBuilder<TypeParameterSymbol> builder = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 212internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 217internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 222internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 227internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\Source\LambdaSymbol.cs (2)
192public override ImmutableArray<TypeParameterSymbol> TypeParameters 194get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\LocalFunctionSymbol.cs (3)
311public override ImmutableArray<TypeParameterSymbol> TypeParameters 312=> _typeParameters.Cast<SourceMethodTypeParameterSymbol, TypeParameterSymbol>(); 436var tpEnclosing = ContainingSymbol.FindEnclosingTypeParameter(name);
Symbols\Source\ParameterHelpers.cs (1)
209default(ImmutableArray<TypeParameterSymbol>);
Symbols\Source\SourceConstructorSymbolBase.cs (2)
132public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 134get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
144public override ImmutableArray<TypeParameterSymbol> TypeParameters 148return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Source\SourceDestructorSymbol.cs (2)
109public override ImmutableArray<TypeParameterSymbol> TypeParameters 111get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\SourceEventAccessorSymbol.cs (2)
186public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 188get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\SourceFixedFieldSymbol.cs (1)
156: base(GeneratedNames.MakeFixedFieldImplementationName(field.Name), typeParameters: ImmutableArray<TypeParameterSymbol>.Empty, typeMap: TypeMap.Empty)
Symbols\Source\SourceMemberContainerSymbol.cs (11)
592foreach (var typeParameter in this.TypeParameters) 1687else if (member is TypeParameterSymbol || member is SynthesizedMethodBaseSymbol) 2182foreach (TypeParameterSymbol typeParameter in this.TypeParameters) 2298foreach (var tp in TypeParameters) 4289ImmutableArray<TypeParameterSymbol>.Empty, 4336ImmutableArray<TypeParameterSymbol>.Empty, 4385ImmutableArray<TypeParameterSymbol>.Empty, 4445ImmutableArray<TypeParameterSymbol>.Empty, 4619ImmutableArray<TypeParameterSymbol>.Empty, 4712ImmutableArray<TypeParameterSymbol>.Empty, 5292foreach (var typeParameter in TypeParameters)
Symbols\Source\SourceMemberMethodSymbol.cs (2)
906foreach (var typeParameter in this.TypeParameters) 990foreach (var typeParameter in TypeParameters)
Symbols\Source\SourceNamedTypeSymbol.cs (4)
138private ImmutableArray<TypeParameterSymbol> MakeTypeParameters(BindingDiagnosticBag diagnostics) 142return ImmutableArray<TypeParameterSymbol>.Empty; 219var tpEnclosing = ContainingType.FindEnclosingTypeParameter(name); 743public override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Source\SourceOrdinaryMethodSymbol.cs (12)
191if (type.DefaultType is TypeParameterSymbol typeParameterSymbol && typeParameterSymbol.DeclaringMethod == (object)args.method) 606var typeParameter1 = typeParameters1[i]; 607var typeParameter2 = typeParameters2[i]; 645var typeParameter = this.TypeParameters[i]; 938public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 939=> ImmutableArray<TypeParameterSymbol>.Empty; 1019public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 1091private ImmutableArray<TypeParameterSymbol> MakeTypeParameters(MethodDeclarationSyntax syntax, BindingDiagnosticBag diagnostics) 1095return ImmutableArray<TypeParameterSymbol>.Empty; 1113var result = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 1140var tpEnclosing = ContainingType.FindEnclosingTypeParameter(name); 1150(TypeParameterSymbol)new SourceOverridingMethodTypeParameterSymbol(
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
79public abstract override ImmutableArray<TypeParameterSymbol> TypeParameters { get; }
Symbols\Source\SourcePropertyAccessorSymbol.cs (2)
334public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 336get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\SourceTypeParameterSymbol.cs (24)
92internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 98internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 104internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 110internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress) 216protected abstract ImmutableArray<TypeParameterSymbol> ContainerTypeParameters 221private TypeParameterBounds GetBounds(ConsList<TypeParameterSymbol> inProgress) 246protected abstract TypeParameterBounds ResolveBounds(ConsList<TypeParameterSymbol> inProgress, BindingDiagnosticBag diagnostics); 583protected override ImmutableArray<TypeParameterSymbol> ContainerTypeParameters 588protected override TypeParameterBounds ResolveBounds(ConsList<TypeParameterSymbol> inProgress, BindingDiagnosticBag diagnostics) 725protected override ImmutableArray<TypeParameterSymbol> ContainerTypeParameters 730protected override TypeParameterBounds ResolveBounds(ConsList<TypeParameterSymbol> inProgress, BindingDiagnosticBag diagnostics) 776public TypeParameterSymbol GetOverriddenTypeParameter(int ordinal) 898var typeParameter = this.OverriddenTypeParameter; 907var typeParameter = this.OverriddenTypeParameter; 916var typeParameter = this.OverriddenTypeParameter; 925var typeParameter = this.OverriddenTypeParameter; 934var typeParameter = this.OverriddenTypeParameter; 943var typeParameter = this.OverriddenTypeParameter; 952TypeParameterSymbol typeParameter = this.OverriddenTypeParameter; 977var typeParameter = this.OverriddenTypeParameter; 982protected override ImmutableArray<TypeParameterSymbol> ContainerTypeParameters 987protected override TypeParameterBounds ResolveBounds(ConsList<TypeParameterSymbol> inProgress, BindingDiagnosticBag diagnostics) 989var typeParameter = this.OverriddenTypeParameter; 1006private TypeParameterSymbol OverriddenTypeParameter
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (3)
704return type is TypeParameterSymbol p && 777public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 779get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Source\TypeParameterBuilder.cs (1)
34internal TypeParameterSymbol MakeSymbol(int ordinal, IList<TypeParameterBuilder> builders, BindingDiagnosticBag diagnostics)
Symbols\Source\TypeParameterConstraintClause.cs (19)
132internal static SmallDictionary<TypeParameterSymbol, bool> BuildIsValueTypeMap( 133ImmutableArray<TypeParameterSymbol> typeParameters, 138var isValueTypeMap = new SmallDictionary<TypeParameterSymbol, bool>(ReferenceEqualityComparer.Instance); 140foreach (TypeParameterSymbol typeParameter in typeParameters) 142isValueType(typeParameter, constraintClauses, isValueTypeMap, ConsList<TypeParameterSymbol>.Empty); 147static bool isValueType(TypeParameterSymbol thisTypeParameter, ImmutableArray<TypeParameterConstraintClause> constraintClauses, SmallDictionary<TypeParameterSymbol, bool> isValueTypeMap, ConsList<TypeParameterSymbol> inProgress) 176if (type is TypeParameterSymbol typeParameter && (object)typeParameter.ContainingSymbol == (object)container) 197internal static SmallDictionary<TypeParameterSymbol, bool> BuildIsReferenceTypeFromConstraintTypesMap( 198ImmutableArray<TypeParameterSymbol> typeParameters, 203var isReferenceTypeFromConstraintTypesMap = new SmallDictionary<TypeParameterSymbol, bool>(ReferenceEqualityComparer.Instance); 205foreach (TypeParameterSymbol typeParameter in typeParameters) 207isReferenceTypeFromConstraintTypes(typeParameter, constraintClauses, isReferenceTypeFromConstraintTypesMap, ConsList<TypeParameterSymbol>.Empty); 212static bool isReferenceTypeFromConstraintTypes(TypeParameterSymbol thisTypeParameter, ImmutableArray<TypeParameterConstraintClause> constraintClauses, 213SmallDictionary<TypeParameterSymbol, bool> isReferenceTypeFromConstraintTypesMap, ConsList<TypeParameterSymbol> inProgress) 236if (type is TypeParameterSymbol typeParameter) 252else if (TypeParameterSymbol.NonTypeParameterConstraintImpliesReferenceType(type))
Symbols\Source\TypeParameterInfo.cs (2)
16public ImmutableArray<TypeParameterSymbol> LazyTypeParameters; 32LazyTypeParameters = ImmutableArray<TypeParameterSymbol>.Empty,
Symbols\SubstitutedMethodSymbol.cs (5)
31private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 91public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 107ImmutableArray<TypeParameterSymbol> typeParameters; 121ImmutableInterlocked.InterlockedCompareExchange(ref _lazyTypeParameters, typeParameters, default(ImmutableArray<TypeParameterSymbol>)); 172public override TypeSymbol GetTypeInferredDuringReduction(TypeParameterSymbol reducedFromTypeParameter)
Symbols\SubstitutedNamedTypeSymbol.cs (4)
40private ImmutableArray<TypeParameterSymbol> _lazyTypeParameters; 88public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 104ImmutableArray<TypeParameterSymbol> typeParameters; 117ImmutableInterlocked.InterlockedCompareExchange(ref _lazyTypeParameters, typeParameters, default(ImmutableArray<TypeParameterSymbol>));
Symbols\SubstitutedTypeParameterSymbol.cs (8)
28internal SubstitutedTypeParameterSymbol(Symbol newContainer, TypeMap map, TypeParameterSymbol substitutedFrom, int ordinal) 49public override TypeParameterSymbol OriginalDefinition 61public override TypeParameterSymbol ReducedFrom 99internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 162_map.SubstituteConstraintTypesDistinctWithoutModifiers(_underlyingTypeParameter, _underlyingTypeParameter.GetConstraintTypes(ConsList<TypeParameterSymbol>.Empty), constraintTypes, null); 170internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 175internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 180internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\Symbol.cs (2)
1382internal static bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, ImmutableArray<TypeParameterSymbol> typeParameters, Symbol owner, ref HashSet<TypeSymbol> checkedTypes) 1384foreach (var typeParameter in typeParameters)
Symbols\SymbolExtensions.cs (4)
432internal static TypeParameterSymbol? EnsureCSharpSymbolOrNull(this ITypeParameterSymbol? symbol, string paramName) 434return (TypeParameterSymbol?)EnsureCSharpSymbolOrNull((ISymbol?)symbol, paramName); 659internal static ITypeParameterSymbol? GetPublicSymbol(this TypeParameterSymbol? symbol) 734internal static ImmutableArray<ITypeParameterSymbol> GetPublicSymbols(this ImmutableArray<TypeParameterSymbol> symbols)
Symbols\SymbolVisitor.cs (1)
115public virtual void VisitTypeParameter(TypeParameterSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
115public virtual TResult VisitTypeParameter(TypeParameterSymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
149/// Called when visiting a <see cref="TypeParameterSymbol" />; Override this with specific 155public virtual TResult VisitTypeParameter(TypeParameterSymbol symbol, TArgument argument)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (2)
122public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (4)
59internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<TypeWithAnnotations>.Empty; 61internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress) => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 63internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 65internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (2)
272TypeParameters = ImmutableArray.Create<TypeParameterSymbol>(typeParameter); 799public override ImmutableArray<TypeParameterSymbol> TypeParameters { get; }
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (2)
51public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedContainer.cs (6)
23private readonly ImmutableArray<TypeParameterSymbol> _typeParameters; 24private readonly ImmutableArray<TypeParameterSymbol> _constructedFromTypeParameters; 33_typeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 41protected SynthesizedContainer(string name, ImmutableArray<TypeParameterSymbol> typeParameters, TypeMap typeMap) 80internal ImmutableArray<TypeParameterSymbol> ConstructedFromTypeParameters => _constructedFromTypeParameters; 82public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters => _typeParameters;
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
176public override ImmutableArray<TypeParameterSymbol> TypeParameters 178get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (2)
56public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
92public override ImmutableArray<TypeParameterSymbol> TypeParameters 94get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (5)
26private ImmutableArray<TypeParameterSymbol> _typeParameters; 43_typeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 60protected void SetTypeParameters(ImmutableArray<TypeParameterSymbol> typeParameters) 158public override ImmutableArray<TypeParameterSymbol> TypeParameters 165return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
85public override ImmutableArray<TypeParameterSymbol> TypeParameters => [];
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
24private readonly ImmutableArray<TypeParameterSymbol> _typeParameters; 86public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters
Symbols\Synthesized\SynthesizedInlineArrayAsReadOnlySpanMethod.cs (1)
15this.SetTypeParameters(ImmutableArray.Create<TypeParameterSymbol>(new SynthesizedSimpleMethodTypeParameterSymbol(this, 0, "TBuffer"), new SynthesizedSimpleMethodTypeParameterSymbol(this, 1, "TElement")));
Symbols\Synthesized\SynthesizedInlineArrayAsSpanMethod.cs (1)
15this.SetTypeParameters(ImmutableArray.Create<TypeParameterSymbol>(new SynthesizedSimpleMethodTypeParameterSymbol(this, 0, "TBuffer"), new SynthesizedSimpleMethodTypeParameterSymbol(this, 1, "TElement")));
Symbols\Synthesized\SynthesizedInlineArrayElementRefMethod.cs (1)
15this.SetTypeParameters(ImmutableArray.Create<TypeParameterSymbol>(new SynthesizedSimpleMethodTypeParameterSymbol(this, 0, "TBuffer"), new SynthesizedSimpleMethodTypeParameterSymbol(this, 1, "TElement")));
Symbols\Synthesized\SynthesizedInlineArrayElementRefReadOnlyMethod.cs (1)
15this.SetTypeParameters(ImmutableArray.Create<TypeParameterSymbol>(new SynthesizedSimpleMethodTypeParameterSymbol(this, 0, "TBuffer"), new SynthesizedSimpleMethodTypeParameterSymbol(this, 1, "TElement")));
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefMethod.cs (1)
15this.SetTypeParameters(ImmutableArray.Create<TypeParameterSymbol>(new SynthesizedSimpleMethodTypeParameterSymbol(this, 0, "TBuffer"), new SynthesizedSimpleMethodTypeParameterSymbol(this, 1, "TElement")));
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefReadOnlyMethod.cs (1)
15this.SetTypeParameters(ImmutableArray.Create<TypeParameterSymbol>(new SynthesizedSimpleMethodTypeParameterSymbol(this, 0, "TBuffer"), new SynthesizedSimpleMethodTypeParameterSymbol(this, 1, "TElement")));
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (6)
42TypeParameters = ImmutableArray.Create<TypeParameterSymbol>(typeParameter); 47public override ImmutableArray<TypeParameterSymbol> TypeParameters { get; } 251internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<TypeWithAnnotations>.Empty; 253internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress) => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 255internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) => ContainingAssembly.GetSpecialType(SpecialType.System_Object); 257internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) => ImmutableArray<NamedTypeSymbol>.Empty;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
132public sealed override ImmutableArray<TypeParameterSymbol> TypeParameters 134get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (2)
163public override ImmutableArray<TypeParameterSymbol> TypeParameters 165get { return ImmutableArray<TypeParameterSymbol>.Empty; }
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
246public override ImmutableArray<TypeParameterSymbol> TypeParameters 250return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
40public override ImmutableArray<TypeParameterSymbol> TypeParameters => ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
209public override ImmutableArray<TypeParameterSymbol> TypeParameters 213return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
131public override ImmutableArray<TypeParameterSymbol> TypeParameters 135return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (2)
64public override ImmutableArray<TypeParameterSymbol> TypeParameters 68return ImmutableArray<TypeParameterSymbol>.Empty;
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
19public SynthesizedSubstitutedTypeParameterSymbol(Symbol owner, TypeMap map, TypeParameterSymbol substitutedFrom, int ordinal)
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (4)
110internal override ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress) 115internal override ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress) 120internal override NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress) 125internal override TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress)
Symbols\TypeMap.cs (29)
26internal static ImmutableArray<TypeWithAnnotations> TypeParametersAsTypeSymbolsWithAnnotations(ImmutableArray<TypeParameterSymbol> typeParameters) 31internal static ImmutableArray<TypeWithAnnotations> TypeParametersAsTypeSymbolsWithIgnoredAnnotations(ImmutableArray<TypeParameterSymbol> typeParameters) 42internal TypeMap(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeWithAnnotations> to, bool allowAlpha = false) 50internal TypeMap(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeParameterSymbol> to, bool allowAlpha = false) 56private TypeMap(SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> mapping) 57: base(new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(mapping, ReferenceEqualityComparer.Instance)) 62private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ForType(NamedTypeSymbol containingType) 66new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(substituted.TypeSubstitution.Mapping, ReferenceEqualityComparer.Instance) : 67new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 70internal TypeMap(NamedTypeSymbol containingType, ImmutableArray<TypeParameterSymbol> typeParameters, ImmutableArray<TypeWithAnnotations> typeArguments) 75TypeParameterSymbol tp = typeParameters[i]; 84private static readonly SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> s_emptyDictionary = 85new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 103private TypeMap WithAlphaRename(ImmutableArray<TypeParameterSymbol> oldTypeParameters, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 107newTypeParameters = ImmutableArray<TypeParameterSymbol>.Empty; 118ArrayBuilder<TypeParameterSymbol> newTypeParametersBuilder = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 125foreach (var tp in oldTypeParameters) 139internal TypeMap WithAlphaRename(NamedTypeSymbol oldOwner, NamedTypeSymbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 145internal TypeMap WithAlphaRename(MethodSymbol oldOwner, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 154out ImmutableArray<TypeParameterSymbol> newTypeParameters, 155out ImmutableArray<TypeParameterSymbol> oldTypeParameters, 173var parameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 200private static SmallDictionary<TypeParameterSymbol, TypeWithAnnotations> ConstructMapping(ImmutableArray<TypeParameterSymbol> from, ImmutableArray<TypeWithAnnotations> to) 202var mapping = new SmallDictionary<TypeParameterSymbol, TypeWithAnnotations>(ReferenceEqualityComparer.Instance); 208TypeParameterSymbol tp = from[i];
Symbols\TypeParameterSymbol.cs (18)
27public new virtual TypeParameterSymbol OriginalDefinition 47public virtual TypeParameterSymbol ReducedFrom 87return this.GetConstraintTypes(ConsList<TypeParameterSymbol>.Empty); 264return this.GetEffectiveBaseClass(ConsList<TypeParameterSymbol>.Empty); 289return this.GetInterfaces(ConsList<TypeParameterSymbol>.Empty); 313return this.GetDeducedBaseType(ConsList<TypeParameterSymbol>.Empty); 374protected static void EnsureAllConstraintsAreResolved(ImmutableArray<TypeParameterSymbol> typeParameters) 376foreach (var typeParameter in typeParameters) 379var unused = typeParameter.GetConstraintTypes(ConsList<TypeParameterSymbol>.Empty); 383internal abstract ImmutableArray<TypeWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress); 385internal abstract ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress); 387internal abstract NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress); 389internal abstract TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress); 395return ((TypeParameterSymbol)constraint).IsReferenceTypeFromConstraintTypes; 486bool? isNotNullable = ((TypeParameterSymbol)constraintType.Type).IsNotNullable; 652return this.Equals(t2 as TypeParameterSymbol, comparison); 655internal bool Equals(TypeParameterSymbol other) 660private bool Equals(TypeParameterSymbol other, TypeCompareKind comparison)
Symbols\TypeParameterSymbolExtensions.cs (7)
11public static bool DependsOn(this TypeParameterSymbol typeParameter1, TypeParameterSymbol typeParameter2) 16Stack<TypeParameterSymbol>? stack = null; 17HashSet<TypeParameterSymbol>? visited = null; 23if (constraintType.Type is TypeParameterSymbol typeParameter) 29visited ??= new HashSet<TypeParameterSymbol>(); 32stack ??= new Stack<TypeParameterSymbol>();
Symbols\TypeSymbol.cs (6)
108var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 239return this.IsTypeParameter() ? ((TypeParameterSymbol)this).EffectiveBaseClassNoUseSiteDiagnostics : this; 245return this.IsTypeParameter() ? ((TypeParameterSymbol)this).EffectiveBaseClass(ref useSiteInfo) : this; 344var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 2104var typeParameter1 = typeParameters1[i]; 2105var typeParameter2 = typeParameters2[i];
Symbols\TypeSymbolExtensions.cs (22)
75var typeParameter = (TypeParameterSymbol)type; 92return type is TypeParameterSymbol { IsValueType: false, IsNotNullable: false }; 119var constraintTypes = ((TypeParameterSymbol)type).ConstraintTypesNoUseSiteDiagnostics; 350public static bool IsMethodTypeParameter(this TypeParameterSymbol p) 426var typeParameter = (TypeParameterSymbol)type; 546return type is { IsRefLikeType: true } or TypeParameterSymbol { AllowsRefLikeType: true }; 1197public static bool ContainsTypeParameter(this TypeSymbol type, TypeParameterSymbol? parameter = null) 1203private static readonly Func<TypeSymbol, TypeParameterSymbol?, bool, bool> s_containsTypeParameterPredicate = 1217public static bool ContainsTypeParameters(this TypeSymbol type, HashSet<TypeParameterSymbol> parameters) 1223private static readonly Func<TypeSymbol, HashSet<TypeParameterSymbol>, bool, bool> s_containsTypeParametersPredicate = 1224(type, parameters, unused) => type.TypeKind == TypeKind.TypeParameter && parameters.Contains((TypeParameterSymbol)type); 1684internal static ImmutableArray<TypeParameterSymbol> GetAllTypeParameters(this NamedTypeSymbol type) 1692var builder = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 1701internal static void GetAllTypeParameters(this NamedTypeSymbol type, ArrayBuilder<TypeParameterSymbol> result) 1716internal static TypeParameterSymbol? FindEnclosingTypeParameter(this NamedTypeSymbol type, string name) 1718var allTypeParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(); 1721TypeParameterSymbol? result = null; 1723foreach (TypeParameterSymbol tpEnclosing in allTypeParameters) 1740internal static TypeParameterSymbol? FindEnclosingTypeParameter(this Symbol methodOrType, string name) 1756foreach (var typeParameter in methodOrType.GetMemberTypeParameters())
Symbols\TypeUnification.cs (6)
190TypeParameterSymbol tp1 = (TypeParameterSymbol)t1.Type; 222var tp2 = (TypeParameterSymbol)t2.Type; 249private static void AddSubstitution(ref MutableTypeMap? substitution, TypeParameterSymbol tp1, TypeWithAnnotations t2) 265private static bool Contains(TypeSymbol type, TypeParameterSymbol typeParam)
Symbols\TypeWithAnnotations.cs (10)
178private static TypeWithAnnotations CreateLazySubstitutedType(TypeSymbol substitutedTypeSymbol, ImmutableArray<CustomModifier> customModifiers, TypeParameterSymbol typeParameter) 212if (((TypeParameterSymbol)typeSymbol).TypeParameterKind == TypeParameterKind.Cref) 326var declaringMethod = (DefaultType as TypeParameterSymbol)?.DeclaringMethod as SourceOrdinaryMethodSymbol; 468if (newTypeWithModifiers.Is((TypeParameterSymbol)typeSymbol) && 473else if (Is((TypeParameterSymbol)typeSymbol) && newTypeWithModifiers.NullableAnnotation != NullableAnnotation.Ignored) 502var typeParameter = (TypeParameterSymbol)typeSymbol; 561public bool Is(TypeParameterSymbol other) 957private readonly TypeParameterSymbol _typeParameter; 962public LazySubstitutedType(ImmutableArray<CustomModifier> customModifiers, TypeParameterSymbol typeParameter)
Symbols\UnboundGenericType.cs (1)
49public static ImmutableArray<TypeWithAnnotations> CreateTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters, int n, DiagnosticInfo errorInfo)
Symbols\VarianceSafety.cs (6)
258private static void CheckTypeParametersVarianceSafety(ImmutableArray<TypeParameterSymbol> typeParameters, MethodSymbol context, BindingDiagnosticBag diagnostics) 260foreach (TypeParameterSymbol typeParameter in typeParameters) 305TypeParameterSymbol typeParam = (TypeParameterSymbol)type; 385TypeParameterSymbol typeParam = namedType.TypeParameters[i]; 441TypeParameterSymbol unsafeTypeParameter,
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (3)
27protected readonly TypeParameterSymbol _underlyingTypeParameter; 29public WrappedTypeParameterSymbol(TypeParameterSymbol underlyingTypeParameter) 35public TypeParameterSymbol UnderlyingTypeParameter
Utilities\TypeSymbolExtensions.cs (1)
184return ((TypeParameterSymbol)type).EffectiveBaseClassNoUseSiteDiagnostics;