示例#1
0
        public void Resolve(ResolveContext ec)
        {
//			using (ec.With (ResolveContext.Options.DoFlowAnalysis, true)) {

            // Keep track of the array initializer, we need it to do array type inference when searching for
            // a matching method.
            if (ec.FileType == SourceFileType.PlayScript)
            {
                if (Expr is AsArrayInitializer)
                {
                    InferArrayInitializer = (AsArrayInitializer)Expr;
                }
                else if (Expr is AsObjectInitializer)
                {
                    InferObjInitializer = (AsObjectInitializer)Expr;
                }
                else if (Expr is AnonymousMethodExpression)
                {
                    Expr = new Cast(new TypeExpression(ec.BuiltinTypes.Delegate, Expr.Location), Expr, Expr.Location);
                }
            }

            // Verify that the argument is readable
            if (ArgType != AType.Out)
            {
                Expr = Expr.Resolve(ec);
            }

            // Verify that the argument is writeable
            if (Expr != null && IsByRef)
            {
                Expr = Expr.ResolveLValue(ec, EmptyExpression.OutAccess);
            }

            if (Expr == null)
            {
                Expr = ErrorExpression.Instance;
            }
//			}
        }
示例#2
0
		public void Resolve (ResolveContext ec)
		{
//			using (ec.With (ResolveContext.Options.DoFlowAnalysis, true)) {

				// Keep track of the array initializer, we need it to do array type inference when searching for
				// a matching method.
				if (ec.FileType == SourceFileType.PlayScript) {
					if (Expr is AsArrayInitializer) {
						InferArrayInitializer = (AsArrayInitializer)Expr;
					} else if (Expr is AsObjectInitializer) {
						InferObjInitializer = (AsObjectInitializer)Expr;
					} else if (Expr is AnonymousMethodExpression) {
						Expr = new Cast(new TypeExpression(ec.BuiltinTypes.Delegate, Expr.Location), Expr, Expr.Location);
					}
				}

				// Verify that the argument is readable
				if (ArgType != AType.Out)
					Expr = Expr.Resolve (ec);

				// Verify that the argument is writeable
				if (Expr != null && IsByRef)
					Expr = Expr.ResolveLValue (ec, EmptyExpression.OutAccess);

				if (Expr == null)
					Expr = ErrorExpression.Instance;
//			}
		}
示例#3
0
		public virtual object Visit (AsArrayInitializer initializer)
		{
			return null;
		}
示例#4
0
 public virtual object Visit(AsArrayInitializer initializer)
 {
     return(null);
 }