本文整理汇总了C#中Mono.CSharp.Expression.Error118方法的典型用法代码示例。如果您正苦于以下问题:C# Expression.Error118方法的具体用法?C# Expression.Error118怎么用?C# Expression.Error118使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.Expression
的用法示例。
在下文中一共展示了Expression.Error118方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoResolve
public override Expression DoResolve (EmitContext ec)
{
//
// First, resolve the expression that is used to
// trigger the invocation
//
if (expr is BaseAccess)
is_base = true;
Expression old = expr;
expr = expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
if (expr == null)
return null;
if (!(expr is MethodGroupExpr)) {
Type expr_type = expr.Type;
if (expr_type != null){
bool IsDelegate = TypeManager.IsDelegateType (expr_type);
if (IsDelegate)
return (new DelegateInvocation (
this.expr, Arguments, loc)).Resolve (ec);
}
}
if (!(expr is MethodGroupExpr)){
expr.Error118 (ResolveFlags.MethodGroup);
return null;
}
//
// Next, evaluate all the expressions in the argument list
//
if (Arguments != null){
foreach (Argument a in Arguments){
if (!a.Resolve (ec, loc))
return null;
}
}
MethodGroupExpr mg = (MethodGroupExpr) expr;
method = OverloadResolve (ec, mg, Arguments, loc);
if (method == null){
Error (-6,
"Could not find any applicable function for this argument list");
return null;
}
MethodInfo mi = method as MethodInfo;
if (mi != null) {
type = TypeManager.TypeToCoreType (mi.ReturnType);
if (!mi.IsStatic && !mg.IsExplicitImpl && (mg.InstanceExpression == null))
SimpleName.Error_ObjectRefRequired (ec, loc, mi.Name);
}
if (type.IsPointer){
if (!ec.InUnsafe){
UnsafeError (loc);
return null;
}
}
//
// Only base will allow this invocation to happen.
//
if (is_base && method.IsAbstract){
Report.Error (205, loc, "Cannot call an abstract base member: " +
FullMethodDesc (method));
return null;
}
if ((method.Attributes & MethodAttributes.SpecialName) != 0){
if (TypeManager.IsSpecialMethod (method))
Report.Error (571, loc, method.Name + ": can not call operator or accessor");
}
eclass = ExprClass.Value;
return this;
}