if (ec.IsInProbingMode)
return this;
- BlockContext bc = new BlockContext (ec.MemberContext, ec.CurrentBlock.Explicit, TypeManager.void_type);
+ BlockContext bc = new BlockContext (ec.MemberContext, ec.CurrentBlock.Explicit, TypeManager.void_type) {
+ CurrentAnonymousMethod = ec.CurrentAnonymousMethod
+ };
+
Expression args = Parameters.CreateExpressionTree (bc, loc);
Expression expr = Block.CreateExpressionTree (ec);
if (expr == null)
Arguments arguments = new Arguments (2);
arguments.Add (new Argument (expr));
arguments.Add (new Argument (args));
- return CreateExpressionFactoryCall ("Lambda",
+ return CreateExpressionFactoryCall (ec, "Lambda",
new TypeArguments (new TypeExpression (delegate_type, loc)),
arguments);
}
if (!TypeManager.IsDelegateType (delegateType))
return null;
- AParametersCollection d_params = TypeManager.GetDelegateParameters (delegateType);
+ AParametersCollection d_params = TypeManager.GetDelegateParameters (ec, delegateType);
if (HasExplicitParameters) {
- if (!VerifyExplicitParameters (delegateType, d_params, ec.IsInProbingMode))
+ if (!VerifyExplicitParameters (ec, delegateType, d_params))
return null;
return Parameters;
// If L has an implicitly typed parameter list we make implicit parameters explicit
// Set each parameter of L is given the type of the corresponding parameter in D
//
- if (!VerifyParameterCompatibility (delegateType, d_params, ec.IsInProbingMode))
+ if (!VerifyParameterCompatibility (ec, delegateType, d_params, ec.IsInProbingMode))
return null;
Type [] ptypes = new Type [Parameters.Count];
return Parameters;
}
- public override Expression DoResolve (ResolveContext ec)
+ protected override Expression DoResolve (ResolveContext ec)
{
//
// Only explicit parameters can be resolved at this point
Arguments arguments = new Arguments (2);
arguments.Add (new Argument (expr));
arguments.Add (new Argument (args));
- return CreateExpressionFactoryCall ("Lambda",
+ return CreateExpressionFactoryCall (ec, "Lambda",
new TypeArguments (new TypeExpression (type, loc)),
arguments);
}
statement = Expr as ExpressionStatement;
if (statement == null)
- Expr.Error_InvalidExpressionStatement ();
+ Expr.Error_InvalidExpressionStatement (ec);
return true;
}