本文整理汇总了C#中Mono.CSharp.Expression.GetSignatureForError方法的典型用法代码示例。如果您正苦于以下问题:C# Expression.GetSignatureForError方法的具体用法?C# Expression.GetSignatureForError怎么用?C# Expression.GetSignatureForError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.Expression
的用法示例。
在下文中一共展示了Expression.GetSignatureForError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Error_ConversionFailed
void Error_ConversionFailed (ResolveContext ec, MethodSpec method, Expression return_type)
{
var invoke_method = Delegate.GetInvokeMethod (type);
string member_name = method_group.InstanceExpression != null ?
Delegate.FullDelegateDesc (method) :
TypeManager.GetFullNameSignature (method);
ec.Report.SymbolRelatedToPreviousError (type);
ec.Report.SymbolRelatedToPreviousError (method);
if (ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1) {
ec.Report.Error (410, loc, "A method or delegate `{0} {1}' parameters and return type must be same as delegate `{2} {3}' parameters and return type",
method.ReturnType.GetSignatureForError (), member_name,
invoke_method.ReturnType.GetSignatureForError (), Delegate.FullDelegateDesc (invoke_method));
return;
}
if (return_type == null) {
ec.Report.Error (123, loc, "A method or delegate `{0}' parameters do not match delegate `{1}' parameters",
member_name, Delegate.FullDelegateDesc (invoke_method));
return;
}
ec.Report.Error (407, loc, "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' return type",
return_type.GetSignatureForError (), member_name,
invoke_method.ReturnType.GetSignatureForError (), Delegate.FullDelegateDesc (invoke_method));
}
示例2: InferType
public bool InferType(ResolveContext ec, Expression right_side)
{
if (type != null)
throw new InternalErrorException ("An implicitly typed local variable could not be redefined");
type = right_side.Type;
if (type == TypeManager.null_type || type == TypeManager.void_type || type == InternalType.AnonymousMethod || type == InternalType.MethodGroup) {
ec.Report.Error (815, loc, "An implicitly typed local variable declaration cannot be initialized with `{0}'",
right_side.GetSignatureForError ());
return false;
}
eclass = ExprClass.Variable;
return true;
}
示例3: Error_IsNotConvertibleToIDisposable
static public void Error_IsNotConvertibleToIDisposable (Expression expr)
{
Report.SymbolRelatedToPreviousError (expr.Type);
Report.Error (1674, expr.Location, "`{0}': type used in a using statement must be implicitly convertible to `System.IDisposable'",
expr.GetSignatureForError ());
}
示例4: ResolveMemberAccess
public virtual MemberExpr ResolveMemberAccess(ResolveContext ec, Expression left, Location loc,
SimpleName original)
{
//
// Precondition:
// original == null || original.Resolve (...) ==> left
//
if (left is TypeExpr) {
left = ((TypeExpr) left).ResolveAsTypeTerminal (ec, false);
if (left == null)
return null;
// TODO: Same problem as in class.cs, TypeTerminal does not
// always do all necessary checks
ObsoleteAttribute oa = left.Type.GetAttributeObsolete ();
if (oa != null && !ec.IsObsolete) {
AttributeTester.Report_ObsoleteMessage (oa, left.GetSignatureForError (), loc, ec.Report);
}
// GenericTypeExpr ct = left as GenericTypeExpr;
// if (ct != null && !ct.CheckConstraints (ec))
// return null;
//
if (!IsStatic) {
SimpleName.Error_ObjectRefRequired (ec, loc, GetSignatureForError ());
return null;
}
return this;
}
if (!IsInstance) {
if (original != null && original.IdenticalNameAndTypeName (ec, left, loc))
return this;
return ResolveExtensionMemberAccess (ec, left);
}
InstanceExpression = left;
return this;
}
示例5: Error_ConversionFailed
void Error_ConversionFailed (ResolveContext ec, MethodBase method, Expression return_type)
{
MethodInfo invoke_method = Delegate.GetInvokeMethod (ec.Compiler, ec.CurrentType, type);
string member_name = delegate_instance_expression != null ?
Delegate.FullDelegateDesc (method) :
TypeManager.GetFullNameSignature (method);
ec.Report.SymbolRelatedToPreviousError (type);
ec.Report.SymbolRelatedToPreviousError (method);
if (RootContext.Version == LanguageVersion.ISO_1) {
ec.Report.Error (410, loc, "A method or delegate `{0} {1}' parameters and return type must be same as delegate `{2} {3}' parameters and return type",
TypeManager.CSharpName (((MethodInfo) method).ReturnType), member_name,
TypeManager.CSharpName (invoke_method.ReturnType), Delegate.FullDelegateDesc (invoke_method));
return;
}
if (return_type == null) {
ec.Report.Error (123, loc, "A method or delegate `{0}' parameters do not match delegate `{1}' parameters",
member_name, Delegate.FullDelegateDesc (invoke_method));
return;
}
ec.Report.Error (407, loc, "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' return type",
return_type.GetSignatureForError (), member_name,
TypeManager.CSharpName (invoke_method.ReturnType), Delegate.FullDelegateDesc (invoke_method));
}