ResolveMemberType() private method

private ResolveMemberType ( ResolveResult target, string identifier, IList typeArguments ) : ResolveResult
target ResolveResult
identifier string
typeArguments IList
return ResolveResult
		public ResolveResult DoResolve(ITypeResolveContext context)
		{
			ResolveResult targetRR = target.DoResolve(context);
			if (targetRR.IsError)
				return targetRR;
			CSharpResolver r = new CSharpResolver(context);
			r.CurrentTypeDefinition = parentTypeDefinition;
			r.UsingScope = parentUsingScope;
			IType[] typeArgs = new IType[typeArguments.Count];
			for (int i = 0; i < typeArgs.Length; i++) {
				typeArgs[i] = typeArguments[i].Resolve(context);
			}
			return r.ResolveMemberType(targetRR, identifier, typeArgs);
		}
		public override ResolveResult Resolve(CSharpResolver resolver)
		{
			ResolveResult targetRR = target.Resolve(resolver);
			if (targetRR.IsError)
				return targetRR;
			IList<IType> typeArgs = typeArguments.Resolve(resolver.CurrentTypeResolveContext);
			using (var busyLock = BusyManager.Enter(this)) {
				if (busyLock.Success) {
					return resolver.ResolveMemberType(targetRR, identifier, typeArgs);
				} else {
					// This can happen for "class Test : $Test.Base$ { public class Base {} }":
					return ErrorResolveResult.UnknownError; // don't cache this error
				}
			}
		}
Ejemplo n.º 3
0
        public ResolveResult DoResolve(ITypeResolveContext context)
        {
            ResolveResult targetRR = target.DoResolve(context);

            if (targetRR.IsError)
            {
                return(targetRR);
            }
            CSharpResolver r = new CSharpResolver(context);

            r.CurrentTypeDefinition = parentTypeDefinition;
            r.UsingScope            = parentUsingScope;
            IType[] typeArgs = new IType[typeArguments.Count];
            for (int i = 0; i < typeArgs.Length; i++)
            {
                typeArgs[i] = typeArguments[i].Resolve(context);
            }
            return(r.ResolveMemberType(targetRR, identifier, typeArgs));
        }
Ejemplo n.º 4
0
        public ResolveResult DoResolve(ITypeResolveContext context)
        {
            CacheManager cacheManager = context.CacheManager;

            if (cacheManager != null)
            {
                ResolveResult cachedResult = cacheManager.GetShared(this) as ResolveResult;;
                if (cachedResult != null)
                {
                    return(cachedResult);
                }
            }

            ResolveResult targetRR = target.DoResolve(context);

            if (targetRR.IsError)
            {
                return(targetRR);
            }
            CSharpResolver r = new CSharpResolver(context);

            r.CurrentTypeDefinition = parentTypeDefinition;
            r.CurrentUsingScope     = parentUsingScope;
            IType[] typeArgs = new IType[typeArguments.Count];
            for (int i = 0; i < typeArgs.Length; i++)
            {
                typeArgs[i] = typeArguments[i].Resolve(context);
            }
            ResolveResult rr = r.ResolveMemberType(targetRR, identifier, typeArgs);

            if (cacheManager != null)
            {
                cacheManager.SetShared(this, rr);
            }
            return(rr);
        }