Exemplo n.º 1
0
        override public void LeaveMethod(Method node)
        {
            InternalMethod derived = (InternalMethod)node.Entity;
            IMethod        super   = derived.Overriden;

            if (null != super)
            {
                TypeMemberModifiers derivedAccess = TypeSystemServices.GetAccess(derived);
                TypeMemberModifiers superAccess   = TypeSystemServices.GetAccess(super);
                if (derivedAccess < superAccess)
                {
                    Error(CompilerErrorFactory.DerivedMethodCannotReduceAccess(
                              node,
                              derived,
                              super,
                              derivedAccess,
                              superAccess));
                }
            }

            CheckUnusedLocals(node);
            CheckAbstractMethodCantHaveBody(node);
            CheckValidExtension(node);
            CheckNotFinalizer(node);
            CheckImplicitReturn(node);
            CheckAmbiguousVariableNames(node);
        }
Exemplo n.º 2
0
        override public void LeaveMethod(Method node)
        {
            InternalMethod derived = (InternalMethod)node.Entity;
            IMethod        super   = derived.Overriden;

            if (null != super)
            {
                TypeMemberModifiers derivedAccess = TypeSystemServices.GetAccess(derived);
                TypeMemberModifiers superAccess   = TypeSystemServices.GetAccess(super);
                if (derivedAccess < superAccess)
                {
                    Error(CompilerErrorFactory.DerivedMethodCannotReduceAccess(
                              node,
                              derived.FullName,
                              super.FullName,
                              derivedAccess,
                              superAccess));
                }
            }

            CheckUnusedLocals(node);
            CheckAbstractMethodCantHaveBody(node);
        }