bool OverloadResolver.IErrorHandler.AmbiguousCandidates(ResolveContext ec, MemberSpec best, MemberSpec ambiguous) { 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()); return(true); }
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, type.Type.GetSignatureForError ()); return true; }
bool OverloadResolver.IErrorHandler.NoArgumentMatch(ResolveContext rc, MemberSpec best) { return(false); }
bool OverloadResolver.IErrorHandler.TypeInferenceFailed(ResolveContext rc, MemberSpec best) { var ms = (MethodSpec)best; TypeSpec source_type = ms.Parameters.ExtensionMethodType; if (source_type != null) { Argument a = arguments[0]; if (TypeManager.IsGenericType(source_type) && InflatedTypeSpec.ContainsTypeParameter(source_type)) { TypeInferenceContext tic = new TypeInferenceContext(source_type.TypeArguments); tic.OutputTypeInference(rc, a.Expr, source_type); if (tic.FixAllTypes(rc)) { source_type = source_type.GetDefinition().MakeGenericType(tic.InferredTypeArguments); } } 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)); return(true); } } if (best.Name == "SelectMany") { rc.Report.Error(1943, loc, "An expression type is incorrect in a subsequent `from' clause in a query expression with source type `{0}'", arguments[0].GetSignatureForError()); } else { rc.Report.Error(1942, loc, "An expression type in `{0}' clause is incorrect. Type inference failed in the call to `{1}'", best.Name.ToLowerInvariant(), best.Name); } return(true); }
public virtual IEnumerable<Attribute> LoadDeclaredAttributes(MemberSpec memberSpec) { if (memberSpec == null) throw new ArgumentNullException(nameof(memberSpec)); return memberSpec.OnLoadDeclaredAttributes(); }
bool OverloadResolver.IErrorHandler.ArgumentMismatch(ResolveContext rc, MemberSpec best, Argument arg, int index) { return(false); }
public override string LoadName(MemberSpec memberSpec) { return memberSpec .Maybe() .Switch() .Case<PropertySpec>().Then(x => Filter.GetPropertyMappedName(x.ReflectedType, x.PropertyInfo)) .Case<TypeSpec>().Then(x => Filter.GetTypeMappedName(x.Type)) .EndSwitch() .OrDefault(() => base.LoadName(memberSpec)); }
bool OverloadResolver.IErrorHandler.AmbiguousCandidates (ResolveContext ec, MemberSpec best, MemberSpec ambiguous) { 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 ()); return true; }
public ReferenceEmitter(MemberSpec ms, int off, ReferenceKind k, RegistersEnum reg) : this(ms, off, k) { Register = reg; }
public override IEnumerable<Attribute> LoadDeclaredAttributes(MemberSpec memberSpec) { var attrs = base.LoadDeclaredAttributes(memberSpec); var typeSpec = memberSpec as TypeSpec; if (typeSpec != null) { var customClientLibraryType = Filter.GetClientLibraryType(typeSpec.Type); if (customClientLibraryType != null) attrs = attrs.Append(new CustomClientLibraryTypeAttribute(customClientLibraryType)); var customJsonConverter = Filter.GetJsonConverterForType(typeSpec.Type); if (customJsonConverter != null) attrs = attrs.Append(new CustomJsonConverterAttribute(customJsonConverter)); } var propSpec = memberSpec as PropertySpec; if (propSpec != null) { var formulaExpr = Filter.GetPropertyFormula(propSpec.ReflectedType, propSpec.PropertyInfo); if (formulaExpr != null) attrs = attrs.Append(new PropertyFormulaAttribute(formulaExpr)); attrs = attrs.Concat( Filter.GetPropertyAttributes(propSpec.ReflectedType, propSpec.PropertyInfo).EmptyIfNull()); } return attrs; }
public ReferenceEmitter(MemberSpec ms, int off, ReferenceKind k) : base(k) { Member = ms; Offset = off; }
public SeeNode(MemberSpec reference) { if (reference == null) throw new ArgumentNullException(nameof(reference)); Reference = reference; }
public virtual string LoadName(MemberSpec memberSpec) { if (memberSpec == null) throw new ArgumentNullException(nameof(memberSpec)); return memberSpec.OnLoadName(); }
bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best) { return false; }
public IDocNode GetSummary(MemberSpec member) { return GetMemberSummary(member.Member); }
bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best) { var ms = (MethodSpec) best; TypeSpec source_type = ms.Parameters.ExtensionMethodType; if (source_type != null) { Argument a = arguments[0]; if (TypeManager.IsGenericType (source_type) && TypeManager.ContainsGenericParameters (source_type)) { TypeInferenceContext tic = new TypeInferenceContext (source_type.TypeArguments); tic.OutputTypeInference (rc, a.Expr, source_type); if (tic.FixAllTypes (rc)) { source_type = source_type.GetDefinition ().MakeGenericType (tic.InferredTypeArguments); } } 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)); return true; } } if (best.Name == "SelectMany") { rc.Report.Error (1943, loc, "An expression type is incorrect in a subsequent `from' clause in a query expression with source type `{0}'", arguments[0].GetSignatureForError ()); } else { rc.Report.Error (1942, loc, "An expression type in `{0}' clause is incorrect. Type inference failed in the call to `{1}'", best.Name.ToLowerInvariant (), best.Name); } return true; }
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, type.Type.GetSignatureForError()); return(true); }
bool OverloadResolver.IErrorHandler.ArgumentMismatch (ResolveContext rc, MemberSpec best, Argument arg, int index) { return false; }
public IDocNode GetSummary(MemberSpec member) { return(GetMemberSummary(member.Member)); }