Пример #1
0
        public bool ResolveExtension(string ext, TypeResolveContext trc, bool errors)
        {
            if (errors && typeargs != null)
            {
                // Don't want to think about how this should be handled.
                throw new InvalidOperationException();
            }

            string exname;

            if (IsUser)
            {
                exname = ((string)t) + ext;
            }
            else
            {
                exname = ((Type)t).FullName + ext;
            }

            UserType exval = trc.Resolve(exname, false);

            if (exval != null)
            {
                this.t   = exval.t;
                resolved = true;
                return(false);
            }

            return(Resolve(trc, errors));
        }
Пример #2
0
        public bool Resolve(TypeResolveContext trc, bool errors)
        {
            if (resolved)
            {
                return(false);
            }

            if (IsUser)
            {
                UserType newval = trc.Resolve((string)t, errors);

                if (newval == null)
                {
                    if (errors)
                    {
                        Console.Error.WriteLine("Failed to resolve type {0}", t);
                    }
                    return(true);
                }

                this.t = newval.t;
            }

            if (typeargs != null)
            {
                bool ret = false;

                foreach (UserType ut in typeargs)
                {
                    ret |= ut.Resolve(trc, errors);
                }

                if (ret)
                {
                    return(ret);
                }
            }

            resolved = true;
            return(false);
        }
Пример #3
0
	public bool Resolve (TypeResolveContext trc, bool errors)
	{
	    if (resolved)
		return false;

	    if (IsUser) {
	        UserType newval = trc.Resolve ((string) t, errors);

		if (newval == null) {
		    if (errors)
			Console.Error.WriteLine ("Failed to resolve type {0}", t);
		    return true;
		}

		this.t = newval.t;
	    }

	    if (typeargs != null) {
		bool ret = false;

		foreach (UserType ut in typeargs)
		    ret |= ut.Resolve (trc, errors);

		if (ret)
		    return ret;
	    }

	    resolved = true;
	    return false;
	}
Пример #4
0
	public bool ResolveExtension (string ext, TypeResolveContext trc, bool errors)
	{
	    if (errors && typeargs != null)
		// Don't want to think about how this should be handled.
		throw new InvalidOperationException ();

	    string exname;

	    if (IsUser)
		exname = ((string) t) + ext;
	    else
		exname = ((Type) t).FullName + ext;

	    UserType exval = trc.Resolve (exname, false);
	    if (exval != null) {
		this.t = exval.t;
		resolved = true;
		return false;
	    }

	    return Resolve (trc, errors);
	}