public override Expression DoResolve (EmitContext ec)
{
+ int counter = TransparentParameter.Counter;
+
Expression e = BuildQueryClause (ec, null, null, null);
e = e.Resolve (ec);
+
+ //
+ // Reset counter in probing mode to ensure that all transparent
+ // identifier anonymous types are created only once
+ //
+ if (ec.IsInProbingMode)
+ TransparentParameter.Counter = counter;
+
return e;
}
public bool NoExactMatch (EmitContext ec, MethodBase method)
{
#if GMCS_SOURCE
- ParameterData pd = TypeManager.GetParameterData (method);
+ AParametersCollection pd = TypeManager.GetParameterData (method);
Type source_type = pd.ExtensionMethodType;
if (source_type != null) {
Argument a = (Argument) Arguments [0];
{
Parameters p = new Parameters (parameters);
- LambdaExpression selector = new LambdaExpression ((TypeContainer)ec.TypeContainer, p, loc);
+ LambdaExpression selector = new LambdaExpression (p, loc);
selector.Block = new SelectorBlock (ec.CurrentBlock, p, ti, loc);
selector.Block.AddStatement (new ContextualReturn (expr));
protected abstract string MethodName { get; }
+ public override void MutateHoistedGenericType (AnonymousMethodStorey storey)
+ {
+ // Nothing to mutate
+ }
+
public virtual AQueryClause Next {
set {
next = value;
//
// Spread resolved initializer type
//
- parameter.ParameterType = type;
- parameter.Resolve (ec);
+ ((ImplicitLambdaParameter) parameter).Type = type;
}
return e;
}
- protected override void Error_InvalidInitializer (Expression initializer)
+ protected override void Error_InvalidInitializer (string initializer)
{
Report.Error (1932, loc, "A range variable `{0}' cannot be initialized with `{1}'",
- Name, initializer.GetSignatureForError ());
+ Name, initializer);
}
}
{
throw new NotSupportedException ();
}
+
+ public override void MutateHoistedGenericType (AnonymousMethodStorey storey)
+ {
+ throw new NotSupportedException ();
+ }
}
public ImplicitQueryParameter (LocatedToken variable)
//
public class TransparentParameter : ImplicitLambdaParameter
{
- static int counter;
+ public static int Counter;
const string ParameterNamePrefix = "<>__TranspIdent";
public TransparentParameter (Location loc)
- : base (ParameterNamePrefix + counter++, loc)
+ : base (ParameterNamePrefix + Counter++, loc)
{
}
}