void DefineTypes() { if (CompileUnit.Modules.Count == 0) return; var types = CollectTypes(); foreach (var type in types) DefineType(type); foreach (var type in types) { DefineGenericParameters(type); DefineTypeMembers(type); } foreach (var module in CompileUnit.Modules) OnModule(module); var typeCreator = new TypeCreator(this, types); // TODO: we might need to create enumerations that appear in attributes before emitting the attributes. EmitAttributes(typeCreator); typeCreator.Run(); }