21 instantiations of TypeMap
Microsoft.CodeAnalysis.CSharp (21)
Binder\Binder_Expressions.cs (1)
10885var substitution = new TypeMap(typeParameters, typeArguments);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4253var map = new TypeMap(leastOverriddenMethod.TypeParameters, typeArguments, allowAlpha: true);
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
193var typeMap = (methodDefinition.Arity > 0) ? new TypeMap(overload.TypeParameters, methodDefinition.TypeParameters) : null;
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
343var typeMap = new TypeMap(typeParameters, IndexedTypeParameterSymbol.Take(typeParameters.Length), allowAlpha: true);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (1)
183typeMap = new TypeMap(typeParametersToSubstitute, TypeParameters, allowAlpha: true);
Symbols\ConstructedMethodSymbol.cs (1)
20map: new TypeMap(constructedFrom.ContainingType, ((MethodSymbol)constructedFrom.OriginalDefinition).TypeParameters, typeArgumentsWithAnnotations),
Symbols\ConstructedNamedTypeSymbol.cs (1)
64map: new TypeMap(constructedFrom.ContainingType, constructedFrom.OriginalDefinition.TypeParameters, typeArgumentsWithAnnotations),
Symbols\ErrorTypeSymbol.cs (1)
667_map = new TypeMap(constructedFrom.ContainingType, constructedFrom.OriginalDefinition.TypeParameters, typeArgumentsWithAnnotations);
Symbols\MemberSignatureComparer.cs (1)
620new TypeMap(
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (1)
227TypeMap candidateMethodTypeMap = new TypeMap(
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
2758var containingTypeMap = new TypeMap(containingTypeParameters, IndexedTypeParameterSymbol.Take(n), allowAlpha: false); 2759var nestedTypeMap = new TypeMap(nestedTypeParameters, IndexedTypeParameterSymbol.Take(nestedTypeParameters.Length), allowAlpha: false);
Symbols\NamedTypeSymbol.cs (1)
989TypeMap substitution = new TypeMap(definition.GetAllTypeParameters(), allTypeArguments);
Symbols\ReducedExtensionMethodSymbol.cs (1)
205var substitution = new TypeMap(typeParams, typeArgsForConstraintsCheck);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (2)
600var typeMap1 = new TypeMap(typeParameters1, indexedTypeParameters, allowAlpha: true); 601var typeMap2 = new TypeMap(typeParameters2, indexedTypeParameters, allowAlpha: true);
Symbols\Source\SourceTypeParameterSymbol.cs (1)
796var typeMap = new TypeMap(overriddenTypeParameters, overridingTypeParameters, allowAlpha: true);
Symbols\TypeMap.cs (2)
93private static readonly TypeMap s_emptyTypeMap = new TypeMap(); 117TypeMap result = new TypeMap(this.Mapping);
Symbols\TypeSymbol.cs (2)
2098var typeMap1 = new TypeMap(typeParameters1, indexedTypeParameters, allowAlpha: true); 2099var typeMap2 = new TypeMap(typeParameters2, indexedTypeParameters, allowAlpha: true);
131 references to TypeMap
Microsoft.CodeAnalysis.CSharp (131)
Binder\Binder_Conversions.cs (1)
1885var allTypeParameters = TypeMap.TypeParametersAsTypeSymbolsWithAnnotations(targetType.OriginalDefinition.GetAllTypeParameters());
Binder\Binder_Deconstruct.cs (1)
259tupleOrDeconstructedTypes = type.TupleElementTypesWithAnnotations.SelectAsArray(TypeMap.AsTypeSymbol);
Binder\Binder_Expressions.cs (1)
10885var substitution = new TypeMap(typeParameters, typeArguments);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (1)
546TypeMap typeMap = new TypeMap(_constructedContainingTypeOfMethod, _methodTypeParameters, fixedArguments);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
4253var map = new TypeMap(leastOverriddenMethod.TypeParameters, typeArguments, allowAlpha: true);
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (2)
314var typeMap = new TypeMap(otherTypeParameters, otherTypeArguments, allowAlpha: true); 888var typeMap = new TypeMap(translatedOriginalDef.GetAllTypeParameters(), translatedTypeArguments, allowAlpha: true);
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (1)
112internal static bool TryCreate(SyntheticBoundNodeFactory F, MethodSymbol method, TypeMap typeMap, out AsyncMethodBuilderMemberCollection collection)
Lowering\ClosureConversion\ClosureConversion.cs (4)
115private TypeMap _currentLambdaBodyTypeMap; 186_currentLambdaBodyTypeMap = TypeMap.Empty; 313protected override TypeMap TypeMap 1561var oldTypeMap = _currentLambdaBodyTypeMap;
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (3)
20private readonly TypeMap _typeMap; 100private ExpressionLambdaRewriter(TypeCompilationState compilationState, TypeMap typeMap, SyntaxNode node, int recursionDepth, BindingDiagnosticBag diagnostics) 112internal static BoundNode RewriteLambda(BoundLambda node, TypeCompilationState compilationState, TypeMap typeMap, int recursionDepth, BindingDiagnosticBag diagnostics)
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (2)
51TypeMap typeMap; 70typeMap = TypeMap.Empty.WithConcatAlphaRename(
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (1)
193var typeMap = (methodDefinition.Arity > 0) ? new TypeMap(overload.TypeParameters, methodDefinition.TypeParameters) : null;
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (2)
638var methodToContainerTypeParametersMap = containerDef.TypeMap; 705internal FieldSymbol DefineCallSiteStorageSymbol(NamedTypeSymbol containerDefinition, NamedTypeSymbol delegateTypeOverMethodTypeParameters, TypeMap methodToContainerTypeParametersMap)
Lowering\MethodToClassRewriter.cs (3)
38protected abstract TypeMap TypeMap { get; } 745TypeMap? typeMap = methodBeingWrapped.ContainingType is SubstitutedNamedTypeSymbol substitutedType ? substitutedType.TypeSubstitution : TypeMap.Empty;
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
176protected override TypeMap TypeMap
Lowering\StateMachineRewriter\StateMachineRewriter.cs (1)
143var typeMap = stateMachineType.TypeMap;
Lowering\SynthesizedMethodBaseSymbol.cs (2)
26internal TypeMap TypeMap { get; private set; } 60protected void AssignTypeMapAndTypeParameters(TypeMap typeMap, ImmutableArray<TypeParameterSymbol> typeParameters)
Operations\CSharpOperationFactory.cs (2)
768return CreateBoundDynamicMemberAccessOperation(methodGroup.ReceiverOpt, TypeMap.AsTypeSymbols(methodGroup.TypeArgumentsOpt), methodGroup.Name, 945return CreateBoundDynamicMemberAccessOperation(boundDynamicMemberAccess.Receiver, TypeMap.AsTypeSymbols(boundDynamicMemberAccess.TypeArgumentsOpt), boundDynamicMemberAccess.Name,
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
343var typeMap = new TypeMap(typeParameters, IndexedTypeParameterSymbol.Take(typeParameters.Length), allowAlpha: true);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (3)
167TypeMap typeMap; 172typeMap = TypeMap.Empty; 194TypeMap typeMap)
Symbols\ConstraintsHelper.cs (2)
891TypeMap substitution, 1031TypeMap substitution,
Symbols\ErrorTypeSymbol.cs (4)
660private readonly TypeMap _map; 695internal override TypeMap TypeSubstitution 705private readonly TypeMap _map; 734internal override TypeMap TypeSubstitution
Symbols\MemberSignatureComparer.cs (22)
460TypeMap? typeMap1 = GetTypeMap(member1); 461TypeMap? typeMap2 = GetTypeMap(member2); 564public static bool HaveSameReturnTypes(Symbol member1, TypeMap? typeMap1, Symbol member2, TypeMap? typeMap2, TypeCompareKind typeComparison) 615private static TypeMap? GetTypeMap(Symbol member) 626private static bool HaveSameConstraints(Symbol member1, TypeMap? typeMap1, Symbol member2, TypeMap? typeMap2) 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) 751private static void SubstituteConstraintTypes(ImmutableArray<TypeWithAnnotations> types, TypeMap? typeMap, HashSet<TypeSymbol> result) 761TypeMap? typeMap1, 763TypeMap? typeMap2, 834private static TypeWithAnnotations SubstituteType(TypeMap? typeMap, TypeWithAnnotations typeSymbol) 839private static bool HaveSameCustomModifiers(ImmutableArray<CustomModifier> customModifiers1, TypeMap? typeMap1, ImmutableArray<CustomModifier> customModifiers2, TypeMap? typeMap2) 845private static ImmutableArray<CustomModifier> SubstituteModifiers(TypeMap? typeMap, ImmutableArray<CustomModifier> customModifiers)
Symbols\MemberSymbolExtensions.cs (2)
345return ((MethodSymbol)symbol).TypeArgumentsWithAnnotations.SelectAsArray(TypeMap.AsTypeSymbol); 348return ((NamedTypeSymbol)symbol).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.SelectAsArray(TypeMap.AsTypeSymbol);
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (3)
227TypeMap candidateMethodTypeMap = new TypeMap( 247private static bool ParametersMatch(ParameterSymbol candidateParam, TypeMap candidateMethodTypeMap, ref ParamInfo<TypeSymbol> targetParam) 275private static bool ReturnTypesMatch(MethodSymbol candidateMethod, TypeMap candidateMethodTypeMap, ref ParamInfo<TypeSymbol> targetReturnParam)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
2758var containingTypeMap = new TypeMap(containingTypeParameters, IndexedTypeParameterSymbol.Take(n), allowAlpha: false); 2759var nestedTypeMap = new TypeMap(nestedTypeParameters, IndexedTypeParameterSymbol.Take(nestedTypeParameters.Length), allowAlpha: false);
Symbols\Metadata\PE\SymbolFactory.cs (1)
149TypeMap substitution = new TypeMap(typeParameters, arguments.SelectAsArray(arg => CreateType(arg.Key, arg.Value)));
Symbols\MethodSymbol.cs (2)
273return TypeMap.TypeParametersAsTypeSymbolsWithAnnotations(TypeParameters); 932internal virtual TypeMap TypeSubstitution
Symbols\NamedTypeSymbol.cs (4)
989TypeMap substitution = new TypeMap(definition.GetAllTypeParameters(), allTypeArguments); 1009TypeMap substitution = new TypeMap(allTypeParameters.ToImmutable(), allTypeArguments.ToImmutable()); 1318return TypeMap.TypeParametersAsTypeSymbolsWithAnnotations(this.TypeParameters); 1347internal virtual TypeMap TypeSubstitution
Symbols\ReducedExtensionMethodSymbol.cs (3)
25private readonly TypeMap _typeMap; 100_typeMap = TypeMap.Empty.WithAlphaRename(reducedFrom, this, out _typeParameters); 205var substitution = new TypeMap(typeParams, typeArgsForConstraintsCheck);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
580TypeMap substitution = new TypeMap(newParameters.ToImmutableAndFree(), newArguments.ToImmutable());
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
113public static ImmutableArray<T> SubstituteExplicitInterfaceImplementations<T>(ImmutableArray<T> unsubstitutedExplicitInterfaceImplementations, TypeMap map) where T : Symbol 124public static T SubstituteExplicitInterfaceImplementation<T>(T unsubstitutedPropertyImplemented, TypeMap map) where T : Symbol
Symbols\Source\SourceFixedFieldSymbol.cs (1)
156: base(GeneratedNames.MakeFixedFieldImplementationName(field.Name), typeParameters: ImmutableArray<TypeParameterSymbol>.Empty, typeMap: TypeMap.Empty)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
983overriddenMethod = overriddenMethod.Construct(TypeMap.TypeParametersAsTypeSymbolsWithIgnoredAnnotations(overridingMethod.TypeParameters));
Symbols\Source\SourceOrdinaryMethodSymbol.cs (3)
478MethodSymbol constructedDefinition = definition.ConstructIfGeneric(TypeMap.TypeParametersAsTypeSymbolsWithIgnoredAnnotations(implementation.TypeParameters)); 600var typeMap1 = new TypeMap(typeParameters1, indexedTypeParameters, allowAlpha: true); 601var typeMap2 = new TypeMap(typeParameters2, indexedTypeParameters, allowAlpha: true);
Symbols\Source\SourceTypeParameterSymbol.cs (4)
761private TypeMap _lazyTypeMap; 782public TypeMap TypeMap 796var typeMap = new TypeMap(overriddenTypeParameters, overridingTypeParameters, allowAlpha: true); 994var map = _map.TypeMap;
Symbols\SubstitutedMethodSymbol.cs (8)
25private readonly TypeMap _inputMap; 30private TypeMap _lazyMap; 46protected SubstitutedMethodSymbol(NamedTypeSymbol containingSymbol, TypeMap map, MethodSymbol originalDefinition, MethodSymbol constructedFrom) 82private TypeMap Map 111var newMap = _inputMap.WithAlphaRename(this.OriginalDefinition, this, out typeParameters); 113var prevMap = Interlocked.CompareExchange(ref _lazyMap, newMap, null); 306internal sealed override TypeMap TypeSubstitution 343TypeMap map = Map;
Symbols\SubstitutedNamedTypeSymbol.cs (7)
29private readonly TypeMap _inputMap; 39private TypeMap _lazyMap; 52protected SubstitutedNamedTypeSymbol(Symbol newContainer, TypeMap map, NamedTypeSymbol originalDefinition, NamedTypeSymbol constructedFrom = null, bool unbound = false, TupleExtraData tupleData = null) 79private TypeMap Map 107var newMap = _inputMap.WithAlphaRename(OriginalDefinition, this, out typeParameters); 109var prevMap = Interlocked.CompareExchange(ref _lazyMap, newMap, null); 425internal sealed override TypeMap TypeSubstitution
Symbols\SubstitutedParameterSymbol.cs (6)
17internal SubstitutedParameterSymbol(MethodSymbol containingSymbol, TypeMap map, ParameterSymbol originalParameter) : 22internal SubstitutedParameterSymbol(PropertySymbol containingSymbol, TypeMap map, ParameterSymbol originalParameter) : 27private SubstitutedParameterSymbol(Symbol containingSymbol, TypeMap map, ParameterSymbol originalParameter) : 55TypeWithAnnotations substituted = ((TypeMap)mapOrType).SubstituteType(this._underlyingParameter.TypeWithAnnotations); 76var map = _mapOrType as TypeMap;
Symbols\SubstitutedTypeParameterSymbol.cs (2)
20private readonly TypeMap _map; 28internal SubstitutedTypeParameterSymbol(Symbol newContainer, TypeMap map, TypeParameterSymbol substitutedFrom, int ordinal)
Symbols\Synthesized\SynthesizedContainer.cs (4)
32TypeMap = TypeMap.Empty; 37TypeMap = TypeMap.Empty.WithConcatAlphaRename(containingMethod, this, out _typeParameters, out _constructedFromTypeParameters); 41protected SynthesizedContainer(string name, ImmutableArray<TypeParameterSymbol> typeParameters, TypeMap typeMap) 52internal TypeMap TypeMap { get; }
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
45var typeMap = interfaceMethod.ContainingType.TypeSubstitution ?? TypeMap.Empty;
Symbols\Synthesized\SynthesizedSubstitutedTypeParameterSymbol.cs (1)
19public SynthesizedSubstitutedTypeParameterSymbol(Symbol owner, TypeMap map, TypeParameterSymbol substitutedFrom, int ordinal)
Symbols\TypeMap.cs (7)
93private static readonly TypeMap s_emptyTypeMap = new TypeMap(); 94public static TypeMap Empty 103private TypeMap WithAlphaRename(ImmutableArray<TypeParameterSymbol> oldTypeParameters, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 117TypeMap result = new TypeMap(this.Mapping); 139internal TypeMap WithAlphaRename(NamedTypeSymbol oldOwner, NamedTypeSymbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 145internal TypeMap WithAlphaRename(MethodSymbol oldOwner, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters) 151internal TypeMap WithConcatAlphaRename(
Symbols\TypeSymbol.cs (3)
1946implementedMethod = implementedMethod.Construct(TypeMap.TypeParametersAsTypeSymbolsWithIgnoredAnnotations(implementingMethod.TypeParameters)); 2098var typeMap1 = new TypeMap(typeParameters1, indexedTypeParameters, allowAlpha: true); 2099var typeMap2 = new TypeMap(typeParameters2, indexedTypeParameters, allowAlpha: true);
Symbols\TypeSymbolExtensions.cs (1)
1989var typeMap = new TypeMap(typeParameters, typeArgumentsBuilder.ToImmutable(), allowAlpha: true);