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 }; }
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; }
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; }