Пример #1
0
        public override Expression Constantify(ResolveContext resolver)
        {
            Expression rr;

            if (expr is ITypeReference)
            {
                rr = new TypeExpression(expr.ResolveAsType(resolver), loc);
            }
            else if (expr is Constant)
            {
                rr = expr.DoResolve(resolver);
            }
            else
            {
                return(null);
            }

            IList <IType> typeArgs = typeArgumentsrefs.Resolve(resolver.CurrentTypeResolveContext);

            return(ResolveMemberAccess(resolver, rr, name, typeArgs));
        }
Пример #2
0
        public override VSC.AST.Expression DoResolve(VSC.TypeSystem.Resolver.ResolveContext rc)
        {
            if (parameters == null)
            {
                anonymous_type = CreateAnonymousType(rc, EmptyParameters);
                RequestedType  = new TypeExpression(anonymous_type, loc);
                return(base.DoResolve(rc));
            }

            bool error = false;

            arguments = new Arguments(parameters.Count);
            for (int i = 0; i < parameters.Count; ++i)
            {
                Expression e = parameters[i].DoResolve(rc);
                if (e == null)
                {
                    error = true;
                    continue;
                }

                arguments.Add(new Argument(e, e.Location));
            }

            if (error)
            {
                return(null);
            }

            anonymous_type = CreateAnonymousType(rc, parameters);
            if (anonymous_type == null)
            {
                return(null);
            }


            return(base.DoResolve(rc));
        }
Пример #3
0
        public override IType ResolveType(ResolveContext resolver)
        {
            TypeExpression trr = Resolve(resolver) as TypeExpression;

            return(trr != null ? trr.Type : new UnknownTypeSpec(null, name, Arity));
        }
Пример #4
0
        public override IType ResolveType(ResolveContext resolver)
        {
            TypeExpression trr = Resolve(resolver) as TypeExpression;

            return(trr != null ? trr.Type : new UnknownTypeSpec(Alias, name, typeArgumentsrefs.Count));
        }