protected static Expression CreateRangeVariableType (ResolveContext rc, Parameter parameter, RangeVariable name, Expression init)
{
var args = new List<AnonymousTypeParameter> (2);
//
// The first argument is the reference to the parameter
//
args.Add (new AnonymousTypeParameter (new RangeParameterReference (parameter), parameter.Name, parameter.Location));
//
// The second argument is the linq expression
//
args.Add (new RangeAnonymousTypeParameter (init, name));
//
// Create unique anonymous type
//
return new NewAnonymousType (args, rc.MemberContext.CurrentMemberDefinition.Parent, name.Location);
}