Exemplo n.º 1
0
 public override bool Resolve(ICollection <IEntity> resultingSet, string name, EntityType typesToConsider)
 {
     if (_namespace.Resolve(resultingSet, name, typesToConsider))
     {
         ImportAnnotations.MarkAsUsed(_import);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        public override void LeaveModule(Boo.Lang.Compiler.Ast.Module module)
        {
            if (module.ContainsAnnotation("merged-module"))
            {
                return;
            }

            var moduleNamespace = module.EnclosingNamespace != null ? module.EnclosingNamespace.Name : string.Empty;

            foreach (Import import in module.Imports)
            {
                if (import.Entity == Error.Default)
                {
                    continue;
                }

                //do not be pedantic about System, the corlib is to be ref'ed anyway
                if (ImportAnnotations.IsUsedImport(import) || import.Namespace == moduleNamespace || import.Namespace == "System")
                {
                    continue;
                }
                Warnings.Add(CompilerWarningFactory.NamespaceNeverUsed(import));
            }
        }