Ejemplo n.º 1
0
        void BindAllParameters()
        {
            Method entryPoint = ContextAnnotations.GetEntryPoint(Context);

            foreach (INodeWithParameters node in _parameters)
            {
                TypeMember member = (TypeMember)node;

                if (member.ContainsAnnotation(PrivateMemberNeverUsed))
                {
                    continue;
                }

                NameResolutionService.EnterNamespace((INamespace)TypeSystemServices.GetEntity(member.DeclaringType));
                CodeBuilder.BindParameterDeclarations(member.IsStatic, node);
                if (!member.IsVisible && !member.IsSynthetic)
                {
                    IExplicitMember explicitMember = member as IExplicitMember;
                    if (null != explicitMember && null != explicitMember.ExplicitInfo)
                    {
                        continue;
                    }
                    if (member == entryPoint)                     //private Main is fine
                    {
                        continue;
                    }
                    member.Annotate(PrivateMemberNeverUsed, null);
                }
            }
        }
Ejemplo n.º 2
0
        protected void WarnIfPrivateMemberNeverUsed(TypeMember node)
        {
            if (NodeType.Constructor == node.NodeType && node.IsStatic)
            {
                return;
            }

            if (!IsVisible(node) && node.ContainsAnnotation("PrivateMemberNeverUsed"))
            {
                Warnings.Add(
                    CompilerWarningFactory.PrivateMemberNeverUsed(node));
            }
        }