Exemple #1
0
        public override Expression DoResolve(ResolveContext ec)
        {
            if (InstanceExpr is EventExpr)
            {
                ((EventExpr)InstanceExpr).Error_CannotAssign(ec);
                return(null);
            }

            Type del_type = InstanceExpr.Type;

            if (del_type == null)
            {
                return(null);
            }

            if (!Delegate.VerifyApplicability(ec, del_type, ref Arguments, loc))
            {
                return(null);
            }

            method = Delegate.GetInvokeMethod(ec.Compiler, ec.CurrentType, del_type);
            type   = TypeManager.TypeToCoreType(method.ReturnType);
            eclass = ExprClass.Value;

            return(this);
        }
Exemple #2
0
        public override Expression DoResolve(EmitContext ec)
        {
            if (InstanceExpr is EventExpr)
            {
                ((EventExpr)InstanceExpr).Error_CannotAssign();
                return(null);
            }

            Type del_type = InstanceExpr.Type;

            if (del_type == null)
            {
                return(null);
            }

            if (Arguments != null)
            {
                foreach (Argument a in Arguments)
                {
                    if (!a.Resolve(ec, loc))
                    {
                        return(null);
                    }
                }
            }

            if (!Delegate.VerifyApplicability(ec, del_type, Arguments, loc))
            {
                return(null);
            }

            method = Delegate.GetInvokeMethod(ec.ContainerType, del_type);
            type   = TypeManager.TypeToCoreType(method.ReturnType);
            eclass = ExprClass.Value;

            return(this);
        }