예제 #1
0
파일: TypeMap.cs 프로젝트: stark-lang/stark
 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);
         }
     }
 }
예제 #2
0
파일: TypeMap.cs 프로젝트: stark-lang/stark
        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);
        }