Ejemplo n.º 1
0
 /// <summary>
 /// Performs some computation with the given module.
 /// </summary>
 public void Visit(IModule module)
 {
     if (module.ModuleName.Value.IndexOfAny(badPosixNameChars) > 0)
       this.ReportError(MetadataError.NotPosixAssemblyName, module, module.ModuleName.Value);
     foreach (var type in module.GetAllTypes()) {
       if (this.allTypes.Contains(type)) {
     this.ReportError(MetadataError.DuplicateEntryInAllTypes, module);
     continue;
       }
       this.allTypes.Add(type);
     }
     this.Visit((IUnit)module);
     //check for duplicate assembly references
     var refsSeenSoFar = new Dictionary<AssemblyIdentity, IAssemblyReference>();
     foreach (var assemblyReference in module.AssemblyReferences) {
       IAssemblyReference duplicate = null;
       if (refsSeenSoFar.TryGetValue(assemblyReference.AssemblyIdentity, out duplicate))
     this.ReportError(MetadataError.DuplicateAssemblyReference, assemblyReference, duplicate);
       else
     refsSeenSoFar.Add(assemblyReference.AssemblyIdentity, assemblyReference);
     }
     foreach (var typeMemberReference in module.GetTypeMemberReferences())
       this.Visit(typeMemberReference);
     foreach (var typeReference in module.GetTypeReferences())
       this.Visit(typeReference);
 }