{
}
- protected override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)
+ public override void Error_TypeDoesNotContainDefinition (ResolveContext ec, TypeSpec type, string name)
{
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?",
{
}
- protected override MethodGroupExpr DoResolveOverload (ResolveContext ec)
+ protected override MethodGroupExpr DoResolveOverload (ResolveContext rc)
{
- MethodGroupExpr rmg = mg.OverloadResolve (ec, ref arguments, this, OverloadResolver.Restrictions.None);
- return rmg;
+ using (rc.Set (ResolveContext.Options.QueryClauseScope)) {
+ return mg.OverloadResolve (rc, ref arguments, this, OverloadResolver.Restrictions.None);
+ }
+ }
+
+ protected override Expression DoResolveDynamic (ResolveContext ec, Expression memberExpr)
+ {
+ ec.Report.Error (1979, loc,
+ "Query expressions with a source or join sequence of type `dynamic' are not allowed");
+ return null;
}
#region IErrorHandler Members
bool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous)
{
+ var emg = mg as ExtensionMethodGroupExpr;
+ var type = emg == null ? mg.InstanceExpression : emg.ExtensionExpression;
+
ec.Report.SymbolRelatedToPreviousError (best);
ec.Report.SymbolRelatedToPreviousError (ambiguous);
ec.Report.Error (1940, loc, "Ambiguous implementation of the query pattern `{0}' for source type `{1}'",
- best.Name, mg.InstanceExpression.GetSignatureForError ());
+ best.Name, type.Type.GetSignatureForError ());
return true;
}
if (!Convert.ImplicitConversionExists (rc, a.Expr, source_type)) {
rc.Report.Error (1936, loc, "An implementation of `{0}' query expression pattern for source type `{1}' could not be found",
- best.Name, TypeManager.CSharpName (a.Type));
+ best.Name, a.Type.GetSignatureForError ());
return true;
}
}
public override Expression BuildQueryClause (ResolveContext ec, Expression lSide, Parameter parameter)
{
-/*
- expr = expr.Resolve (ec);
- if (expr == null)
- return null;
-
- 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));
- return null;
- }
-*/
-
if (IdentifierType != null)
expr = CreateCastExpression (expr);
}
public QueryBlock (Block parent, Location start)
- : base (parent, ParametersCompiled.EmptyReadOnlyParameters, start)
+ : base (parent, ParametersCompiled.EmptyReadOnlyParameters, start, Flags.CompilerGenerated)
{
- flags |= Flags.CompilerGenerated;
}
public void AddRangeVariable (RangeVariable variable)
{
variable.Block = this;
- AddLocalName (variable.Name, variable);
+ TopBlock.AddLocalName (variable.Name, variable, true);
}
public override void Error_AlreadyDeclared (string name, INamedBlockVariable variable, string reason)