public ModifyTypeSymbol(ModifyType type)
 {
     Name = "@@" + type.ToString();
     ModifyType = type;
     var g = new GenericSymbol("T", new List<AttributeSymbol>(), new List<Scope>());
     _Generics = new GenericSymbol[] { g };
     _Inherit = new TypeSymbol[] { g };
 }
示例#2
0
 public static int FindGenericIndex(IReadOnlyList<GenericsInstance> inst, GenericSymbol generic)
 {
     for (var i = 0; i < inst.Count; ++i)
     {
         if (inst[i].Generic == generic)
         {
             return i;
         }
     }
     return -1;
 }
示例#3
0
 private GenericSymbol ImportGenericType(Type type)
 {
     var attribute = new List<AttributeSymbol>();
     AppendEmbededAttribute(attribute, type);
     var constraint = CreateConstraintList(type.GetGenericParameterConstraints());
     var elem = new GenericSymbol(type.Name, attribute, constraint);
     if (ImportDictionary.ContainsKey(type))
     {
         return (GenericSymbol)ImportDictionary[type];
     }
     ImportDictionary.Add(type, elem);
     return elem;
 }