Mono.CSharp.ResolveContext.LookupExtensionMethod C# (CSharp) Method

LookupExtensionMethod() public method

public LookupExtensionMethod ( System.TypeSpec extensionType, string name, int arity, NamespaceEntry &scope ) : IList
extensionType System.TypeSpec
name string
arity int
scope NamespaceEntry
return IList
		public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
		{
			return MemberContext.LookupExtensionMethod (extensionType, name, arity, ref scope);
		}

Usage Example

Example #1
0
        protected override Expression DoResolve(ResolveContext ec)
        {
            eclass = ExprClass.PropertyAccess;

            bool must_do_cs1540_check = false;
            ec.Report.DisableReporting ();
            bool res = ResolveGetter (ec, ref must_do_cs1540_check);
            ec.Report.EnableReporting ();

            if (!res) {
                if (InstanceExpression != null) {
                    TypeSpec expr_type = InstanceExpression.Type;
                    ExtensionMethodGroupExpr ex_method_lookup = ec.LookupExtensionMethod (expr_type, Name, 0, loc);
                    if (ex_method_lookup != null) {
                        ex_method_lookup.ExtensionExpression = InstanceExpression;
                        ex_method_lookup.SetTypeArguments (ec, targs);
                        return ex_method_lookup.Resolve (ec);
                    }
                }

                ResolveGetter (ec, ref must_do_cs1540_check);
                return null;
            }

            if (!InstanceResolve (ec, false, must_do_cs1540_check))
                return null;

            //
            // Only base will allow this invocation to happen.
            //
            if (IsBase && spec.IsAbstract) {
                Error_CannotCallAbstractBase (ec, TypeManager.GetFullNameSignature (spec));
            }

            if (spec.MemberType.IsPointer && !ec.IsUnsafe){
                UnsafeError (ec, loc);
            }

            if (!ec.IsObsolete) {
                ObsoleteAttribute oa = spec.GetAttributeObsolete ();
                if (oa != null)
                    AttributeTester.Report_ObsoleteMessage (oa, GetSignatureForError (), loc, ec.Report);
            }

            return this;
        }
All Usage Examples Of Mono.CSharp.ResolveContext::LookupExtensionMethod