예제 #1
0
        internal override void CheckValid(ValidityContext vctxt, TypeEnvironment typeEnv)
        {
            if (Invalid != null || typeEnv.Type.Invalid != null)
            {
                return;
            }
            var ctxt = MessageContextBuilders.Member(vctxt.Global, typeEnv.Assembly, typeEnv.Type, this);

            if (Get != null)
            {
                Invalid = Get.CheckValid(vctxt, ctxt, typeEnv);
                if (Invalid != null)
                {
                    return;
                }
            }
            if (Set != null)
            {
                Invalid = Set.CheckValid(vctxt, ctxt, typeEnv);
                if (Invalid != null)
                {
                    return;
                }
            }
            Invalid = FieldType.CheckValid(vctxt, ctxt, typeEnv);
            if (Invalid != null)
            {
                vctxt.ImplementableMemberDef(typeEnv.Assembly, typeEnv.Type, this);
            }
        }
예제 #2
0
        internal override void CheckValid(ValidityContext vctxt, TypeEnvironment typeEnv)
        {
            if (Invalid != null || typeEnv.Type.Invalid != null)
            {
                return;
            }
            var ctxt = MessageContextBuilders.Member(vctxt.Global, typeEnv.Assembly, typeEnv.Type, this);

            if (Add != null)
            {
                Invalid = Add.CheckValid(vctxt, ctxt, typeEnv);
                if (Invalid != null)
                {
                    return;
                }
            }
            if (Remove != null)
            {
                Invalid = Remove.CheckValid(vctxt, ctxt, typeEnv);
                if (Invalid != null)
                {
                    return;
                }
            }
            Invalid = HandlerType.CheckValid(vctxt, ctxt, typeEnv);
            if (Invalid != null)
            {
                return;
            }

            vctxt.ImplementableMemberDef(typeEnv.Assembly, typeEnv.Type, this);
        }
예제 #3
0
        internal override void CheckValid(ValidityContext vctxt, TypeEnvironment typeEnv)
        {
            if (Invalid != null || typeEnv.Type.Invalid != null)
                return;
            var ctxt = MessageContextBuilders.Member(vctxt.Global, typeEnv.Assembly, typeEnv.Type, this);
            if (Add != null)
            {
                Invalid = Add.CheckValid(vctxt, ctxt, typeEnv);
                if (Invalid != null)
                    return;
            }
            if (Remove != null)
            {
                Invalid = Remove.CheckValid(vctxt, ctxt, typeEnv);
                if (Invalid != null)
                    return;
            }
            Invalid = HandlerType.CheckValid(vctxt, ctxt, typeEnv);
            if (Invalid != null)
                return;

            vctxt.ImplementableMemberDef(typeEnv.Assembly, typeEnv.Type, this);
        }
예제 #4
0
        internal override void CheckValid(ValidityContext vctxt, TypeEnvironment typeEnv)
        {
            if (Invalid != null || typeEnv.Type.Invalid != null)
                return;

            var methEnv = typeEnv.AddMethod(this).AddSelfMethodBoundArguments();
            for (var i = 0; i < TypeParameters.Count; i++)
            {
                TypeParameters[i].CheckValid(vctxt, methEnv);
                if (TypeParameters[i].Invalid != null)
                {
                    Invalid = new InvalidInfo
                        (MessageContextBuilders.TypeArg(ParameterFlavor.Method, i), TypeParameters[i].Invalid);
                    return;
                }
            }
            var ctxt = MessageContextBuilders.Member(vctxt.Global, typeEnv.Assembly, typeEnv.Type, this);
            foreach (var p in ValueParameters)
            {
                Invalid = p.Type.CheckValid(vctxt, ctxt, methEnv);
                if (Invalid != null)
                    return;
            }
            if (Result != null)
            {
                Invalid = Result.Type.CheckValid(vctxt, ctxt, methEnv);
                if (Invalid != null)
                    return;
            }

            if (vctxt.IgnoreMethodDefBody(typeEnv.Assembly, typeEnv.Type, this))
                return;

            foreach (var l in Locals)
            {
                Invalid = l.Type.CheckValid(vctxt, ctxt, methEnv);
                if (Invalid != null)
                    return;
            }
            var instructions = Instructions(vctxt.Global);
            if (instructions != null)
            {
                foreach (var i in instructions.Body)
                {
                    Invalid = i.CheckValid(vctxt, ctxt, methEnv);
                    if (Invalid != null)
                        return;
                    Invalid = vctxt.ImplementableInstruction(ctxt, methEnv.Assembly, methEnv.Type, this, i);
                    if (Invalid != null)
                        return;
                }
            }

            vctxt.ImplementableMemberDef(typeEnv.Assembly, typeEnv.Type, this);
        }
예제 #5
0
 internal override void CheckValid(ValidityContext vctxt, TypeEnvironment typeEnv)
 {
     if (Invalid != null || typeEnv.Type.Invalid != null)
         return;
     var ctxt = MessageContextBuilders.Member(vctxt.Global, typeEnv.Assembly, typeEnv.Type, this);
     if (Get != null)
     {
         Invalid = Get.CheckValid(vctxt, ctxt, typeEnv);
         if (Invalid != null)
             return;
     }
     if (Set != null)
     {
         Invalid = Set.CheckValid(vctxt, ctxt, typeEnv);
         if (Invalid != null)
             return;
     }
     Invalid = FieldType.CheckValid(vctxt, ctxt, typeEnv);
     if (Invalid != null)
         vctxt.ImplementableMemberDef(typeEnv.Assembly, typeEnv.Type, this);
 }
예제 #6
0
        internal override void CheckValid(ValidityContext vctxt, TypeEnvironment typeEnv)
        {
            if (Invalid != null || typeEnv.Type.Invalid != null)
            {
                return;
            }

            var methEnv = typeEnv.AddMethod(this).AddSelfMethodBoundArguments();

            for (var i = 0; i < TypeParameters.Count; i++)
            {
                TypeParameters[i].CheckValid(vctxt, methEnv);
                if (TypeParameters[i].Invalid != null)
                {
                    Invalid = new InvalidInfo
                                  (MessageContextBuilders.TypeArg(ParameterFlavor.Method, i), TypeParameters[i].Invalid);
                    return;
                }
            }
            var ctxt = MessageContextBuilders.Member(vctxt.Global, typeEnv.Assembly, typeEnv.Type, this);

            foreach (var p in ValueParameters)
            {
                Invalid = p.Type.CheckValid(vctxt, ctxt, methEnv);
                if (Invalid != null)
                {
                    return;
                }
            }
            if (Result != null)
            {
                Invalid = Result.Type.CheckValid(vctxt, ctxt, methEnv);
                if (Invalid != null)
                {
                    return;
                }
            }

            if (vctxt.IgnoreMethodDefBody(typeEnv.Assembly, typeEnv.Type, this))
            {
                return;
            }

            foreach (var l in Locals)
            {
                Invalid = l.Type.CheckValid(vctxt, ctxt, methEnv);
                if (Invalid != null)
                {
                    return;
                }
            }
            var instructions = Instructions(vctxt.Global);

            if (instructions != null)
            {
                foreach (var i in instructions.Body)
                {
                    Invalid = i.CheckValid(vctxt, ctxt, methEnv);
                    if (Invalid != null)
                    {
                        return;
                    }
                    Invalid = vctxt.ImplementableInstruction(ctxt, methEnv.Assembly, methEnv.Type, this, i);
                    if (Invalid != null)
                    {
                        return;
                    }
                }
            }

            vctxt.ImplementableMemberDef(typeEnv.Assembly, typeEnv.Type, this);
        }