//
//
- class QueryExpression : AQueryClause
+ public class QueryExpression : AQueryClause
{
public QueryExpression (Block block, AQueryClause query)
: base (null, null, query.Location)
}
}
- abstract class AQueryClause : ShimExpression
+ public abstract class AQueryClause : ShimExpression
{
class QueryExpressionAccess : MemberAccess
{
{
}
- protected override Expression Error_MemberLookupFailed (ResolveContext ec, Type container_type, Type qualifier_type,
- Type queried_type, string name, string class_name, MemberTypes mt, BindingFlags bf)
+ protected override Expression Error_MemberLookupFailed (ResolveContext ec, TypeSpec container_type, TypeSpec qualifier_type,
+ TypeSpec queried_type, string name, int arity, string class_name, MemberKind mt, BindingRestriction bf)
{
ec.Report.Error (1935, loc, "An implementation of `{0}' query expression pattern could not be found. " +
"Are you missing `System.Linq' using directive or `System.Core.dll' assembly reference?",
return rmg;
}
- public bool AmbiguousCall (ResolveContext ec, MethodBase ambiguous)
+ public bool AmbiguousCall (ResolveContext ec, MethodSpec ambiguous)
{
- ec.Report.SymbolRelatedToPreviousError ((MethodInfo) mg);
+ ec.Report.SymbolRelatedToPreviousError (mg.BestCandidate);
ec.Report.SymbolRelatedToPreviousError (ambiguous);
ec.Report.Error (1940, loc, "Ambiguous implementation of the query pattern `{0}' for source type `{1}'",
mg.Name, mg.InstanceExpression.GetSignatureForError ());
return true;
}
- public bool NoExactMatch (ResolveContext ec, MethodBase method)
+ public bool NoExactMatch (ResolveContext ec, MethodSpec method)
{
- AParametersCollection pd = TypeManager.GetParameterData (method);
- Type source_type = pd.ExtensionMethodType;
+ var pd = method.Parameters;
+ TypeSpec source_type = pd.ExtensionMethodType;
if (source_type != null) {
Argument a = arguments [0];
if (TypeManager.IsGenericType (source_type) && TypeManager.ContainsGenericParameters (source_type)) {
- TypeInferenceContext tic = new TypeInferenceContext (TypeManager.GetTypeArguments (source_type));
+ TypeInferenceContext tic = new TypeInferenceContext (source_type.TypeArguments);
tic.OutputTypeInference (ec, a.Expr, source_type);
if (tic.FixAllTypes (ec)) {
- source_type = TypeManager.DropGenericTypeArguments (source_type).MakeGenericType (tic.InferredTypeArguments);
+ source_type = source_type.GetDefinition ().MakeGenericType (tic.InferredTypeArguments);
}
}
}
}
- if (!TypeManager.IsGenericMethod (method))
+ if (!method.IsGeneric)
return false;
if (mg.Name == "SelectMany") {
//
// A query clause with an identifier (range variable)
//
- abstract class ARangeVariableQueryClause : AQueryClause
+ public abstract class ARangeVariableQueryClause : AQueryClause
{
sealed class RangeAnonymousTypeParameter : AnonymousTypeParameter
{
{
}
- protected static Expression CreateRangeVariableType (ToplevelBlock block, IMemberContext context, SimpleMemberName name, Expression init)
+ protected static Expression CreateRangeVariableType (ToplevelBlock block, TypeContainer container, SimpleMemberName name, Expression init)
{
var args = new List<AnonymousTypeParameter> (2);
args.Add (new AnonymousTypeParameter (block.Parameters [0]));
args.Add (new RangeAnonymousTypeParameter (init, name));
- return new NewAnonymousType (args, context.CurrentTypeDefinition, name.Location);
+ return new NewAnonymousType (args, container, name.Location);
}
}
if (expr == null)
return null;
- if (TypeManager.IsDynamicType (expr.Type) || expr.Type == TypeManager.void_type) {
+ if (expr.Type == InternalType.Dynamic || expr.Type == TypeManager.void_type) {
ec.Report.Error (1979, expr.Location,
"Query expression with a source or join sequence of type `{0}' is not allowed",
TypeManager.CSharpName (expr.Type));
}
}
- class GroupBy : AQueryClause
+ public class GroupBy : AQueryClause
{
Expression element_selector;
ToplevelBlock element_block;
}
}
- class Join : ARangeVariableQueryClause
+ public class Join : ARangeVariableQueryClause
{
readonly SimpleMemberName lt;
ToplevelBlock inner_selector, outer_selector;
result_selector_expr = next.Expr;
next = next.next;
} else {
- result_selector_expr = CreateRangeVariableType (block, ec.MemberContext, into_variable,
+ result_selector_expr = CreateRangeVariableType (block, ec.MemberContext.CurrentMemberDefinition.Parent, into_variable,
new SimpleName (into_variable.Value, into_variable.Location));
}
}
}
- class GroupJoin : Join
+ public class GroupJoin : Join
{
readonly SimpleMemberName into;
}
}
- class Let : ARangeVariableQueryClause
+ public class Let : ARangeVariableQueryClause
{
public Let (ToplevelBlock block, TypeContainer container, SimpleMemberName identifier, Expression expr)
: base (block, CreateRangeVariableType (block, container, identifier, expr))
}
}
- class Select : AQueryClause
+ public class Select : AQueryClause
{
public Select (ToplevelBlock block, Expression expr, Location loc)
: base (block, expr, loc)
}
}
- class SelectMany : ARangeVariableQueryClause
+ public class SelectMany : ARangeVariableQueryClause
{
SimpleMemberName lt;
result_selector_expr = next.Expr;
next = next.next;
} else {
- result_selector_expr = CreateRangeVariableType (block, ec.MemberContext, lt, new SimpleName (lt.Value, lt.Location));
+ result_selector_expr = CreateRangeVariableType (block, ec.MemberContext.CurrentMemberDefinition.Parent, lt, new SimpleName (lt.Value, lt.Location));
}
LambdaExpression result_selector = new LambdaExpression (lt.Location);
}
}
- class Where : AQueryClause
+ public class Where : AQueryClause
{
public Where (ToplevelBlock block, BooleanExpression expr, Location loc)
: base (block, expr, loc)
}
}
- class OrderByAscending : AQueryClause
+ public class OrderByAscending : AQueryClause
{
public OrderByAscending (ToplevelBlock block,Expression expr)
: base (block, expr, expr.Location)
}
}
- class OrderByDescending : AQueryClause
+ public class OrderByDescending : AQueryClause
{
public OrderByDescending (ToplevelBlock block, Expression expr)
: base (block, expr, expr.Location)
}
}
- class ThenByAscending : OrderByAscending
+ public class ThenByAscending : OrderByAscending
{
public ThenByAscending (ToplevelBlock block, Expression expr)
: base (block, expr)
}
}
- class ThenByDescending : OrderByDescending
+ public class ThenByDescending : OrderByDescending
{
public ThenByDescending (ToplevelBlock block, Expression expr)
: base (block, expr)
Identifier = identifier.Value;
}
- public static void Reset ()
+ public new static void Reset ()
{
Counter = 0;
}