internal TypeMap(NamedTypeSymbol containingType, ImmutableArray <TypeParameterSymbol> typeParameters, ImmutableArray <TypeSymbolWithAnnotations> typeArguments) : base(ForType(containingType)) { for (int i = 0; i < typeParameters.Length; i++) { TypeParameterSymbol tp = typeParameters[i]; TypeSymbolWithAnnotations ta = typeArguments[i]; if (!ta.Is(tp)) { Mapping.Add(tp, ta); } } }
private static SmallDictionary <TypeParameterSymbol, TypeSymbolWithAnnotations> ConstructMapping(ImmutableArray <TypeParameterSymbol> from, ImmutableArray <TypeSymbolWithAnnotations> to) { var mapping = new SmallDictionary <TypeParameterSymbol, TypeSymbolWithAnnotations>(ReferenceEqualityComparer.Instance); Debug.Assert(from.Length == to.Length); for (int i = 0; i < from.Length; i++) { TypeParameterSymbol tp = from[i]; TypeSymbolWithAnnotations ta = to[i]; if (!ta.Is(tp)) { mapping.Add(tp, ta); } } return(mapping); }